本文整理了Java中javax.swing.JTabbedPane.addTab()
方法的一些代码示例,展示了JTabbedPane.addTab()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.addTab()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:addTab
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private static void createTabs(){
tabbedPane = new JTabbedPane();
canvasPanel1 = new JPanel();
canvasPanel1.setLayout(new BorderLayout());
tabbedPane.addTab("jME3 Canvas 1", canvasPanel1);
canvasPanel2 = new JPanel();
canvasPanel2.setLayout(new BorderLayout());
tabbedPane.addTab("jME3 Canvas 2", canvasPanel2);
frame.getContentPane().add(tabbedPane);
currentPanel = canvasPanel1;
}
代码示例来源:origin: wiztools/rest-client
private JTabbedPane initJTPResponse(){
JTabbedPane jtp = new JTabbedPane();
// Header Tab
jtp.addTab("Headers", jp_res_headers.getComponent());
// Response body
jtp.addTab("Body", jp_res_body.getComponent());
// Test result
jtp.addTab("Test Result", jp_res_test.getComponent());
// Stats
jtp.addTab("Stats", jp_res_stats.getComponent());
return jtp;
}
代码示例来源:origin: 4thline/cling
@PostConstruct
public void init() {
addWindowListener(
new WindowAdapter() {
@Override
public void windowClosing(WindowEvent windowEvent) {
dispose();
presenter.onViewDisposed();
}
}
);
tabs.setFont(new Font(Font.DIALOG, Font.PLAIN, 20));
for (int i = 0; i < SUPPORTED_INSTANCES; i++) {
InstanceView transportView = avTransportViewInstance.get();
transportView.init(i);
transportViews.put(i, transportView);
tabs.addTab(Integer.toString(i), transportView.asUIComponent());
}
getContentPane().add(tabs, BorderLayout.CENTER);
setResizable(false);
pack();
setVisible(true);
}
代码示例来源:origin: marytts/marytts
jLabel5 = new javax.swing.JLabel();
cbSpeakerBitsPerSample = new javax.swing.JComboBox();
jPanel_TimingOptions = new javax.swing.JPanel();
jLabel_BufferAdded = new javax.swing.JLabel();
jSpinner_BufferAdded = new javax.swing.JSpinner();
jSpinner_SilenceDuration = new javax.swing.JSpinner();
jLabel_SilenceDurationBeforeRecUnits = new javax.swing.JLabel();
jPanel_DisplayOptions = new javax.swing.JPanel();
jCheckBox_SystemLookAndFeel = new javax.swing.JCheckBox();
jCheckBox_ShowTestOutput = new javax.swing.JCheckBox();
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(jLabel_Message)).addContainerGap()));
jTabbedPane_Options.addTab("Audio", jPanel_AudioOptions);
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(jLabel_SilenceDuration)
.add(jLabel_SilenceDurationBeforeRecUnits)).add(141, 141, 141)));
jTabbedPane_Options.addTab("Timing", jPanel_TimingOptions);
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jCheckBox_RedAlertMode)
.addContainerGap(207, Short.MAX_VALUE)));
jTabbedPane_Options.addTab("Display", jPanel_DisplayOptions);
代码示例来源:origin: stackoverflow.com
setLayout(new BorderLayout()); //Here
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("DayGui", new DayGui());
tabbedPane.addTab("OfficeCalc", new OfficeAreaCalculator());
add(tabbedPane);
代码示例来源:origin: wildfly/wildfly
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
add(new JScrollPane(table));
JPanel key=new JPanel(new FlowLayout(FlowLayout.LEFT));
key.add(new JLabel("Key "));
key.add(key_field);
add(key);
JPanel value=new JPanel(new FlowLayout(FlowLayout.LEFT));
value.add(new JLabel("Value"));
value.add(value_field);
add(value);
JPanel repl_count=new JPanel(new FlowLayout(FlowLayout.LEFT));
repl_count.add(new JLabel("Replication count"));
repl_count.add(repl_count_field);
setOpaque(true);
root_pane.addTab("Data", this);
JPanel perf_panel=new JPanel();
perf_panel.setLayout(new BoxLayout(perf_panel, BoxLayout.Y_AXIS));
perf_panel.setOpaque(true);
root_pane.addTab("Perf test", perf_panel);
代码示例来源:origin: ron190/jsql-injection
JPanel panelError = new JPanel(new BorderLayout());
JPanel panelLimit = new JPanel();
panelLimit.setLayout(new BoxLayout(panelLimit, BoxLayout.LINE_AXIS));
panelLimit.add(new JLabel(" Overflow limit: "));
SqlEngine.TAB_ERROR.addTab(methodError.getName(), panelError);
代码示例来源:origin: net.sourceforge.jadex/jadex-tools-base-swing
public void run()
{
ClasspathPanel classpath = new ClasspathPanel();
JTabbedPane tabs = new JTabbedPane();
tabs.addTab("Platform Config", new PlatformConfigPanel(classpath));
tabs.addTab("Classpath", classpath);
JFrame f = new JFrame("Jadex Platform Configuration");
f.getContentPane().add(tabs, BorderLayout.CENTER);
f.pack();
f.setLocation(SGUI.calculateMiddlePosition(f));
f.setVisible(true);
}
});
代码示例来源:origin: stackoverflow.com
JLabel label = new JLabel("Tab1");
label.setHorizontalTextPosition(JLabel.TRAILING); // Set the text position regarding its icon
label.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
tabbedPane.addTab(null, new JPanel());
tabbedPane.setTabComponentAt(0, label); // Here set the custom tab component
代码示例来源:origin: stackoverflow.com
public class Test {
public static void main(String[] args) throws BadLocationException {
JFrame frame = new JFrame("Test");
JTabbedPane tabs = new JTabbedPane();
JTextPane textPane = new JTextPane();
textPane.getDocument().insertString(0, "Hello World!", null);
tabs.addTab("Test", new JScrollPane(textPane));
frame.add(tabs);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300);
frame.setVisible(true);
}
}
代码示例来源:origin: stackoverflow.com
jScrollPane.setPreferredSize(new Dimension(300, 300));
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("abc", jScrollPane);
jFrame.setVisible(true);
代码示例来源: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: magefree/mage
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel6 = new javax.swing.JPanel();
pnlProxy = new javax.swing.JPanel();
lblProxyServer = new javax.swing.JLabel();
txtIdeaTitle = new javax.swing.JTextField();
);
jTabbedPane1.addTab("Give feedback", jPanel6);
代码示例来源:origin: stackoverflow.com
JTabbedPane parent = new JTabbedPane();
JPanel child = new JPanel(new BorderLayout());
// Create label with centrally aligned text (default is left).
JLabel label = new JLabel("Hello, World", JLabel.CENTER_ALIGNMENT);
// Add label to center of the child panel.
child.add(label, BorderLayout.CENTER);
// Add child panel as a tab within parent JTabbedPane.
// The child panel will expand to fit the size of the tab.
parent.addTab("My Tab", child);
代码示例来源:origin: cytoscape/application
/**
* Creates a new PhoebeNodeControl object.
*
* @param view DOCUMENT ME!
*/
public PhoebeNodeControl(GraphView view) {
JFrame frame = new JFrame("Node Control");
JTabbedPane tabbed = new JTabbedPane();
this.view = view;
//Add Control tabs
tabbed.addTab("Align", createAlignTab());
tabbed.addTab("Circular", createCircularTab());
frame.getContentPane().add(tabbed);
frame.pack();
frame.setVisible(true);
}
代码示例来源:origin: 4thline/cling
public void init(StateVariableAllowedValueRange volumeRange) {
addWindowListener(
new WindowAdapter() {
@Override
public void windowClosing(WindowEvent windowEvent) {
dispose();
presenter.onViewDisposed();
}
}
);
tabs.setFont(new Font(Font.DIALOG, Font.PLAIN, 20));
for (int i = 0; i < SUPPORTED_INSTANCES; i++) {
InstanceView controlView = renderingControlViewInstance.get();
controlView.init(i, volumeRange);
controlViews.put(i, controlView);
tabs.addTab(Integer.toString(i), controlView.asUIComponent());
}
getContentPane().add(tabs, BorderLayout.CENTER);
setResizable(false);
pack();
setVisible(true);
}
代码示例来源:origin: wiztools/rest-client
private JTabbedPane initJTPRequest(){
JTabbedPane jtp = new JTabbedPane();
jtp.addTab("Method", jp_req_method.getComponent());
jtp.addTab("Header", jp_2col_req_headers);
jtp.addTab("Cookie", jp_2col_req_cookies);
jtp.addTab("Body", jp_req_body.getComponent());
jtp.addTab("Auth", jp_req_auth.getComponent());
jtp.addTab("SSL", jp_req_ssl.getComponent());
jtp.addTab("Test", jp_req_test.getComponent());
代码示例来源:origin: SonarSource/sonarqube
tabbedPane.addTab("Component details", null, componentDetailsTab, null);
tabbedPane.addTab("Source", null, sourceTab, null);
tabbedPane.addTab("Highlighting", null, highlightingTab, null);
tabbedPane.addTab("Symbol references", null, symbolTab, null);
tabbedPane.addTab("Coverage", null, coverageTab, null);
tabbedPane.addTab("Duplications", null, duplicationTab, null);
tabbedPane.addTab("Tests", null, testsTab, null);
tabbedPane.addTab("Issues", null, issuesTab, null);
tabbedPane.addTab("External Issues", null, externalIssuesTab, null);
tabbedPane.addTab("Measures", null, measuresTab, null);
tabbedPane.addTab("SCM", null, scmTab, null);
tabbedPane.addTab("Active Rules", null, activeRuleTab, null);
tabbedPane.addTab("Add Hoc Rules", null, adHocRuleTab, null);
tabbedPane.addTab("Quality Profiles", null, qualityProfileTab, null);
tabbedPane.addTab("Plugins", null, pluginTab, null);
代码示例来源:origin: magefree/mage
jPanel2 = new javax.swing.JPanel();
tabPane = new javax.swing.JTabbedPane();
tabResult = new javax.swing.JLayeredPane();
pnlText = new javax.swing.JLayeredPane();
lblAdditionalInfo = new javax.swing.JLabel();
lblResultImage = new javax.swing.JLabel();
tabStatistics = new javax.swing.JPanel();
lblDurationGame = new javax.swing.JLabel();
txtDurationGame = new javax.swing.JLabel();
lblResultImage.setBounds(0, 0, 610, 250);
tabPane.addTab("Result", tabResult);
);
tabPane.addTab("Statistics", tabStatistics);
代码示例来源:origin: stackoverflow.com
JTabbedPane tabs = new JTabbedPane();
JFrame frame = new JFrame();
JMenuBar bar = new JMenuBar();
bar.add(new JMenu("menu"));
frame.setJMenuBar(bar);
frame.add(new JButton("button"));
JPanel tab1 = new JPanel(new BorderLayout());
tab1.add(frame.getJMenuBar(),BorderLayout.NORTH);
tab1.add(frame.getContentPane());
tabs.addTab("1", tab1);
内容来源于网络,如有侵权,请联系作者删除!