javax.swing.JTextPane.setBounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中javax.swing.JTextPane.setBounds()方法的一些代码示例,展示了JTextPane.setBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.setBounds()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:setBounds

JTextPane.setBounds介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
        Math.max(size.width, width),
        Math.max(size.height, height));
  } else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: antlr/antlrworks

public void setBounds(int x, int y, int width, int height) {
  if(!wrap) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
        Math.max(size.width, width), Math.max(size.height, height));
  } else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-console

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
        Math.max(size.width, width),
        Math.max(size.height, height));
  } else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
            Math.max(size.width, width),
            Math.max(size.height, height));
  }
  else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
        Math.max(size.width, width),
        Math.max(size.height, height));
  } else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
            Math.max(size.width, width),
            Math.max(size.height, height));
  }
  else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: org.kohsuke.droovy/groovy

public void setBounds(int x, int y, int width, int height) {
  if (unwrapped) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
            Math.max(size.width, width),
            Math.max(size.height, height));
  }
  else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: antlr/antlrworks

public void setBounds(int x, int y, int width, int height) {
  if(!wrap) {
    Dimension size = this.getPreferredSize();
    super.setBounds(x, y,
        Math.max(size.width, width), Math.max(size.height, height));
  } else {
    super.setBounds(x, y, width, height);
  }
}

代码示例来源:origin: stackoverflow.com

JTextPane tfCharacterDescription = new JTextPane();
tfCharacterDescription.setBounds(12, 12, 320, 110); //set the size
tfCharacterDescription.setContentType("text/html");//This is essential!
tfCharacterDescription.setText(
    "<html><div style='text-align: center;'>This is a human. <br>"
    + "The Humans has been good Warriors for centuries <br>"
    + "but they just cant get the hang of using a <br>"
    + "bow the right way.</html>"
  );

代码示例来源:origin: stackoverflow.com

protected JPanel createPanel(String input) {
  JPanel inst = new JPanel();
  inst.setVisible(true);
  final JTextField textField = new JTextField();
  textField.setVisible(true);
  textField.setBounds(12, 12, 80, 30);
  JButton button = new JButton();        
  button.setVisible(true);
  button.setBounds(100, 12, 80, 30);
  final JTextPane textPane = new JTextPane();
  textPane.setBounds(12, 54, 168, 40);
  inst.add(textPane);
  textPane.setVisible(true);

  button.addActionListener(new ActionListener(){

    @Override
    public void actionPerformed(ActionEvent arg0) {
      textPane.setText(textPane.getText() + textField.getText());
    }});

  inst.setLayout(null);
  inst.add(button);
  inst.add(textField);
  ary.add(inst);
  tabIndex = index;
  index++;
  return inst;
}

代码示例来源:origin: ontop/ontop

private void createContent() {
  this.setTitle("Validate Mapping...");
  this.setSize(new Dimension(500, 360));
  Container panel = this.getContentPane();
  panel.setLayout(new BorderLayout());
  JTextPane area = new JTextPane();
  area.setBounds(0, 0, 298, 273);
  area.setEditable(false);
  area.setBackground(Color.WHITE);
  area.setDocument(doc);
  JScrollPane areaScrollPane = new JScrollPane(area);
  areaScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  areaScrollPane.setBounds(0, 0, 300, 275);
  JButton button = new JButton();
  button.setText("OK");
  button.setBounds(120, 290, 60, 25);
  button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent arg0) {
      closed = true;
      myself.dispose();
    }
  });
  button.requestFocus();
  panel.add(areaScrollPane, BorderLayout.CENTER);
  panel.add(button, BorderLayout.SOUTH);
  this.setResizable(true);
}

代码示例来源:origin: stackoverflow.com

public class AddWordWindow extends JFrame{

public AddWordWindow(){
  getContentPane().setLayout(null);

  JTextPane wordText = new JTextPane();
  wordText.setBounds(10, 21, 82, 20);
  getContentPane().add(wordText);

  JTextArea descriptionText = new JTextArea();
  descriptionText.setBounds(10, 66, 143, 57);
  getContentPane().add(descriptionText);
  descriptionText.setEnabled(false);

  wordText.addKeyListener(new KeyAdapter() {

    @Override
    public void keyTyped(KeyEvent e) {              
      if(wordText.getText().length()>2){
        descriptionText.setEnabled(true);                   
      }
    }           
  });
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

jtpFontPreview.setDocument(docFontPreview);
jtpFontPreview.setMargin(new Insets(4, 4, 4, 4));
jtpFontPreview.setBounds(0, 0, 120, 18);
jtpFontPreview.setText(getFontSampleString(defaultText));
Object[] panelContents = { attribName, jcmbFontlist, Translatrix.getTranslationString("FontSample"), jtpFontPreview };

代码示例来源:origin: org.protege/protege-editor-owl

int topOffset = rcInsets.top;
iconLabel.setBounds(leftOffset, topOffset, iconWidth, iconHeight);
textPane.setBounds(leftOffset + iconWidth, topOffset, textWidth, textHeight);
deprecatedLabel.setBounds(leftOffset + iconWidth + textWidth, topOffset, deprecatedWidth, deprecatedHeight);

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

int topOffset = rcInsets.top;
iconLabel.setBounds(leftOffset, topOffset, iconWidth, iconHeight);
textPane.setBounds(leftOffset + iconWidth, topOffset, textWidth, textHeight);

代码示例来源:origin: stackoverflow.com

saldoText.setText(s);
saldoText.setEditable(false);
saldoText.setBounds(208, 354, 42, 22);
frame.getContentPane().add(saldoText);

代码示例来源:origin: protegeproject/protege

int textPaneY = topOffset;
iconComponent.setBounds(leftOffset, topOffset, iconPreferredSize.width, iconPreferredSize.height);
textPane.setBounds(leftOffset + iconPreferredSize.width + 2, textPaneY, textWidth, textHeight);

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

int textPaneY = topOffset;
iconComponent.setBounds(leftOffset, topOffset, iconPreferredSize.width, iconPreferredSize.height);
textPane.setBounds(leftOffset + iconPreferredSize.width + 2, textPaneY, textWidth, textHeight);

相关文章

JTextPane类方法