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

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

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

JTabbedPane.setBounds介绍

暂无

代码示例

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

public static void main(String[] args) {
  JFrame frame = new JFrame();
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.setBounds(0, 0, 300, 400);
  frame.setLayout(null);
  final JTabbedPane tabbedPane = new JTabbedPane();
  tabbedPane.addTab("One", new JPanel());
  tabbedPane.addTab("Two", new JPanel());
  tabbedPane.addTab("Three", new JPanel());
  tabbedPane.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
      System.out.println("Tab: " + tabbedPane.getSelectedIndex());
    }
  });
  tabbedPane.setBounds(0, 0, 300, 400);
  frame.add(tabbedPane);
  frame.setVisible(true);
}

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

public void designMainPanel() {
  setLayout(null); //here it's null but it's working now
  JTabbedPane tab1 = getJtpView();
  tab1.setBounds(0, 0, 650, 520); //←---fixed:set bound to child JTabbedPane 
  add(tab1);
}

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

public GenerateGUI() {
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setBounds(100, 100, 450, 300);
  contentPane = new JPanel();
  contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  setContentPane(contentPane);
  contentPane.setLayout(null);

  JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
  tabbedPane.setBounds(10, 11, 414, 240);
  contentPane.add(tabbedPane);

  JPanel[] panels = new JPanel[3];

  for (int i = 0; i < 3; i++){
    panels[i] = new JPanel();
    panels[i].setVisible(true);
    tabbedPane.addTab("Tab " + Integer.toString(i), null, panels[i], null);
  }
}

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

JTabbedPane preupdatetab = new JTabbedPane();
preupdatetab.setForeground(new Color(255,0,0).darker());
preupdatetab.setBounds(30,15,930,300);
preupdate.add(preupdatetab);
precomplete.setLayout(null);
preupdatetab.add(precomplete,"Complete Change");
preonce.setLayout(null);
preupdatetab.add(preonce,"Qty Change");
changelocationpanel = new JPanel();
changelocationpanel.setLayout(null);
preupdatetab.add(changelocationpanel,"Change Location");
changesaleprice = new JPanel();
changesaleprice.setLayout(null);
preupdatetab.add(changesaleprice,"Change Sale Price");
changebookprice = new JPanel();
changebookprice.setLayout(null);
preupdatetab.add(changebookprice,"Change Book Price");
changevendor = new JPanel();
changevendor.setLayout(null);
preupdatetab.add(changevendor,"Change Vendor");
changeitemname = new JPanel();
changeitemname.setLayout(null);
preupdatetab.add(changeitemname,"Change Item Name");

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

private void createTabbedPane()
{
  tabs = new JTabbedPane();
  tabs.setBounds(5, 5, 580, 300);
  tabs.add("Mode", new ModePanel(controller));
  tabs.add("Externals", new ExternalProgramsPanel(controller));
  tabs.add("Input", new InputPanel(controller));
  tabs.add("Output", new OutputPanel(controller));
  tabs.add("Database", new SQLPanel(controller));
  tabs.add("Cache", new CachePanel(controller));
  tabs.add("Logging", new LoggingPanel(controller));
  tabs.add("Debug", new DebugPanel(controller));
  tabs.add("Filter", new FilterPanel(controller));
  this.add(tabs);
}

代码示例来源:origin: dkpro/dkpro-jwpl

private void createTabbedPane()
{
  tabs = new JTabbedPane();
  tabs.setBounds(5, 5, 580, 300);
  tabs.add("Mode", new ModePanel(controller));
  tabs.add("Externals", new ExternalProgramsPanel(controller));
  tabs.add("Input", new InputPanel(controller));
  tabs.add("Output", new OutputPanel(controller));
  tabs.add("Database", new SQLPanel(controller));
  tabs.add("Cache", new CachePanel(controller));
  tabs.add("Logging", new LoggingPanel(controller));
  tabs.add("Debug", new DebugPanel(controller));
  tabs.add("Filter", new FilterPanel(controller));
  this.add(tabs);
}

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

public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    int xOffset = insets.left;
    int yOffset = insets.top;
    int availWidth = parent.getWidth() - insets.left - insets.right;
    int availHeight = parent.getHeight() - insets.top - insets.bottom;
    Dimension buttonPrefDim = button.getPreferredSize();
    int leftAndRightColWidth = (availWidth - buttonPrefDim.width) / 2;
    tabbedPane.setBounds(xOffset, yOffset, leftAndRightColWidth, availHeight);
    Component tabComponent = tabbedPane.getComponentAt(0);
    int listYOffset = tabComponent.getBounds().y;
    sp.setBounds(xOffset + leftAndRightColWidth + buttonPrefDim.width,
           yOffset + listYOffset,
           tabComponent.getWidth(),
           tabComponent.getHeight());
    button.setBounds(xOffset + leftAndRightColWidth, yOffset + availHeight/2, buttonPrefDim.width, buttonPrefDim.height);
  }
}

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

public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    int xOffset = insets.left;
    int yOffset = insets.top;
    int availWidth = parent.getWidth() - insets.left - insets.right;
    int availHeight = parent.getHeight() - insets.top - insets.bottom;
    Dimension buttonPrefDim = button.getPreferredSize();
    int leftAndRightColWidth = (availWidth - buttonPrefDim.width) / 2;
    tabbedPane.setBounds(xOffset, yOffset, leftAndRightColWidth, availHeight);
    Component tabComponent = tabbedPane.getComponentAt(0);
    int listYOffset = tabComponent.getBounds().y;
    sp.setBounds(xOffset + leftAndRightColWidth + buttonPrefDim.width,
           yOffset + listYOffset,
           tabComponent.getWidth(),
           tabComponent.getHeight());
    button.setBounds(xOffset + leftAndRightColWidth, yOffset + availHeight/2, buttonPrefDim.width, buttonPrefDim.height);
  }
}

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

public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    int xOffset = insets.left;
    int yOffset = insets.top;
    int availWidth = parent.getWidth() - insets.left - insets.right;
    int availHeight = parent.getHeight() - insets.top - insets.bottom;
    Dimension buttonPrefDim = button.getPreferredSize();
    int leftAndRightColWidth = (availWidth - buttonPrefDim.width) / 2;
    tabbedPane.setBounds(xOffset, yOffset, leftAndRightColWidth, availHeight);
    Component tabComponent = tabbedPane.getComponentAt(0);
    int listYOffset = tabComponent.getBounds().y;
    sp.setBounds(xOffset + leftAndRightColWidth + buttonPrefDim.width,
           yOffset + listYOffset,
           tabComponent.getWidth(),
           tabComponent.getHeight());
    button.setBounds(xOffset + leftAndRightColWidth, yOffset + availHeight/2, buttonPrefDim.width, buttonPrefDim.height);
  }
}

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

public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    int xOffset = insets.left;
    int yOffset = insets.top;
    int availWidth = parent.getWidth() - insets.left - insets.right;
    int availHeight = parent.getHeight() - insets.top - insets.bottom;
    Dimension buttonPrefDim = button.getPreferredSize();
    int leftAndRightColWidth = (availWidth - buttonPrefDim.width) / 2;
    tabbedPane.setBounds(xOffset, yOffset, leftAndRightColWidth, availHeight);
    Component tabComponent = tabbedPane.getComponentAt(0);
    int listYOffset = tabComponent.getBounds().y;
    sp.setBounds(xOffset + leftAndRightColWidth + buttonPrefDim.width,
           yOffset + listYOffset,
           tabComponent.getWidth(),
           tabComponent.getHeight());
    button.setBounds(xOffset + leftAndRightColWidth, yOffset + availHeight/2, buttonPrefDim.width, buttonPrefDim.height);
  }
}

代码示例来源:origin: annmuor/jnode

tabbedPane.setBounds(0, 0, frmJnodeConfigurator.getWidth(),
    frmJnodeConfigurator.getHeight());
tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 630, 419);
panel.add(tabbedPane);

代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 634, 465);
getContentPane().add(tabbedPane);

代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 560, bottomOfPage-100);
getContentPane().add(tabbedPane);

代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 560, bottomOfPage-100);
getContentPane().add(tabbedPane);

代码示例来源:origin: robward-scisys/sldeditor

Localisation.getString(
        FieldConfigBase.class, "FieldConfigInlineFeature.gml.tooltip"));
tabbedPane.setBounds(0, 0, inlineGML.getWidth(), inlineGML.getHeight());

代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 560, bottomOfPage-100);
getContentPane().add(tabbedPane);

代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 560, bottomOfPage-100);
getContentPane().add(tabbedPane);

代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 634, bottomOfPage-100);
getContentPane().add(tabbedPane);

代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui

tabbedPane.setBounds(0, 0, 634, bottomOfPage - 100);
getContentPane().add(tabbedPane);

相关文章

JTabbedPane类方法