本文整理了Java中javax.swing.JTabbedPane.add()
方法的一些代码示例,展示了JTabbedPane.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.add()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:add
暂无
代码示例来源:origin: kiegroup/optaplanner
public CurriculumCoursePanel() {
setLayout(new BorderLayout());
JTabbedPane tabbedPane = new JTabbedPane();
roomsPanel = new TimeTablePanel<>();
tabbedPane.add("Rooms", new JScrollPane(roomsPanel));
teachersPanel = new TimeTablePanel<>();
tabbedPane.add("Teachers", new JScrollPane(teachersPanel));
curriculaPanel = new TimeTablePanel<>();
tabbedPane.add("Curricula", new JScrollPane(curriculaPanel));
add(tabbedPane, BorderLayout.CENTER);
setPreferredSize(PREFERRED_SCROLLABLE_VIEWPORT_SIZE);
}
代码示例来源:origin: wiztools/rest-client
private JTabbedPane initJTPRequest(){
JTabbedPane jtp = new JTabbedPane();
jtp.add("Etc.", jp_req_etc.getComponent());
代码示例来源:origin: stackoverflow.com
setLayout(new BorderLayout());
JPanel jp = new JPanel();
jp.setLayout(new BorderLayout());
JTabbedPane tb = new JTabbedPane();
tb.setUI(new CustomTabbedPaneUI());
tb.add("Tab1", new JTextArea(""));
tb.add("Tab2", new JTextArea(""));
tb.add("Tab3", new JTextArea(""));
tb.add("Tab4", new JTextArea(""));
tb.add("Tab5", new JTextArea(""));
jp.add(tb, BorderLayout.CENTER);
add(jp, BorderLayout.CENTER);
tb.setEnabledAt(1, false);
tb.setEnabledAt(3, false);
frame.getContentPane().add(new TabbedPane());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 200);
代码示例来源:origin: apache/pdfbox
panel = new JPanel();
panel.setPreferredSize(new Dimension(300, 500));
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
tabbedPane = new JTabbedPane();
if (stream.isImage())
tabbedPane.add("Image view", view.getStreamPanel());
tabbedPane.add("Text view", view.getStreamPanel());
tabbedPane.add("Hex view", hexView.getPane());
代码示例来源:origin: igniterealtime/Smack
JPanel sublayout = new JPanel(new BorderLayout());
sublayout.add(new JScrollPane(messageTextArea), BorderLayout.CENTER);
tabbedPane.add("All Packets", allPane);
tabbedPane.setToolTipTextAt(0, "Sent and received packets processed by Smack");
sentText.setEditable(false);
sentText.setForeground(new Color(112, 3, 3));
tabbedPane.add("Raw Sent Packets", new JScrollPane(sentText));
tabbedPane.setToolTipTextAt(1, "Raw text of the sent packets");
receivedText.setEditable(false);
receivedText.setForeground(new Color(6, 76, 133));
tabbedPane.add("Raw Received Packets", new JScrollPane(receivedText));
tabbedPane.setToolTipTextAt(
2,
代码示例来源:origin: stackoverflow.com
private final JTabbedPane pane = new JTabbedPane();
pane.add("Tab " + String.valueOf(i), new TabContent(i, color));
pane.setBackgroundAt(i, color);
this.add(pane);
setOpaque(true);
setBackground(color);
add(new JLabel("Tab content " + String.valueOf(i)));
JFrame f = new JFrame("TabColors");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(this);
f.pack();
f.setLocationRelativeTo(null);
代码示例来源:origin: jaltekruse/OpenNotebook
public void addDoc(Document doc) {
int numTabs = docTabs.getTabCount();
openDocs.add(new DocViewerPanel(doc, getTopLevelContainer(), this));
// remove the old adding new doc tab
docTabs.remove(numTabs - 1);
// add new doc
docTabs.add(openDocs.get(openDocs.size() - 1),
openDocs.get(openDocs.size() - 1).getDoc().getName());
DocTabClosePanel temp = new DocTabClosePanel(this,
openDocs.get(openDocs.size() - 1));
tabLabels.add(temp);
docTabs.setTabComponentAt(openDocs.size() - 1, temp);
// add back creation tab
docTabs.add(new JPanel(), "+");
docTabs.setSelectedIndex(docTabs.getTabCount() - 2);
}
代码示例来源:origin: infinitest/infinitest
InfinitestMainFrame(InfinitestResultsPane resultsPane, InfinitestLogPane logPane) {
this.resultsPane = resultsPane;
this.logPane = logPane;
initializeFrame();
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add("Results", resultsPane);
tabbedPane.add("Logging", logPane);
add(tabbedPane);
}
代码示例来源:origin: wiztools/rest-client
JPanel jp = this;
jp.setLayout(new BorderLayout(5, 5));
jp.add(jp_north, BorderLayout.NORTH);
JTabbedPane jtp = new JTabbedPane();
JPanel jp_summary = new JPanel();
jp_summary.setLayout(new GridLayout(3, 1));
jp_t.setLayout(new FlowLayout(FlowLayout.LEFT));
jp_t.add(jp_summary);
jtp.add("Summary", jp_t);
jt.setPreferredScrollableViewportSize(d);
jsp_jt_failures = new JScrollPane(jt);
jtp.add("Failures", jsp_jt_failures);
jt.setPreferredScrollableViewportSize(d);
jsp_jt_errors = new JScrollPane(jt);
jtp.add("Errors", jsp_jt_errors);
jtp.add("Trace", jsp_jta_trace);
代码示例来源:origin: kiegroup/optaplanner
public TennisPanel() {
setLayout(new BorderLayout());
JTabbedPane tabbedPane = new JTabbedPane();
datesPanel = new TimeTablePanel<>();
tabbedPane.add("Dates", new JScrollPane(datesPanel));
confrontationsPanel = new TimeTablePanel<>();
tabbedPane.add("Confrontations", new JScrollPane(confrontationsPanel));
add(tabbedPane, BorderLayout.CENTER);
setPreferredSize(PREFERRED_SCROLLABLE_VIEWPORT_SIZE);
}
代码示例来源:origin: stackoverflow.com
JTabbedPane tabbed = new JTabbedPane();
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
tabbed.add(new JScrollPane(panel1), "Panel 1");
tabbed.add(new JScrollPane(panel2), "Panel 2");
代码示例来源:origin: igniterealtime/Smack
private void addInformationPanel() {
JPanel informationPanel = new JPanel();
informationPanel.setLayout(new BorderLayout());
JPanel connPanel = new JPanel();
connPanel.setLayout(new GridBagLayout());
connPanel.setBorder(BorderFactory.createTitledBorder("XMPPConnection information"));
JPanel packetsPanel = new JPanel();
packetsPanel.setLayout(new GridLayout(1, 1));
packetsPanel.setBorder(BorderFactory.createTitledBorder("Transmitted Packets"));
tabbedPane.add("Information", new JScrollPane(informationPanel));
tabbedPane.setToolTipTextAt(4, "Information and statistics about the debugged connection");
代码示例来源:origin: javalite/jar-explorer
/**
*
* @param jarFileName name of jar file (fully qualified)
* @param resourceName path to resource within the jar file
* @throws IOException
*/
private void buildForHTML(String jarFileName, String resourceName) throws IOException
{
JEditorPane htmlPane = new JEditorPane(new URL("jar:file:" + jarFileName + "!/" + resourceName));
htmlPane.setEditable(false);
JTextArea sourceArea = new JTextArea(Util.readResourceAsString(jarFileName, resourceName));
sourceArea.setEditable(false);
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add("HTML", new JScrollPane(htmlPane));
tabbedPane.add("Source", new JScrollPane(sourceArea));
sourceArea.setFont(new Font("Monospaced", Font.PLAIN, sourceArea.getFont().getSize() ));
getContentPane().add(tabbedPane, BorderLayout.CENTER);
}
代码示例来源:origin: igniterealtime/Smack
tabbedPane = new JTabbedPane();
JPanel informationPanel = new JPanel();
informationPanel.setLayout(new BoxLayout(informationPanel, BoxLayout.Y_AXIS));
JPanel versionPanel = new JPanel();
versionPanel.setLayout(new BoxLayout(versionPanel, BoxLayout.X_AXIS));
versionPanel.setMaximumSize(new Dimension(2000, 31));
JPanel iqProvidersPanel = new JPanel();
iqProvidersPanel.setLayout(new GridLayout(1, 1));
iqProvidersPanel.setBorder(BorderFactory.createTitledBorder("Installed IQ Providers"));
informationPanel.add(extensionProvidersPanel);
tabbedPane.add("Smack Info", informationPanel);
frame.getContentPane().add(tabbedPane);
代码示例来源:origin: kiegroup/optaplanner
public MeetingSchedulingPanel() {
setLayout(new BorderLayout());
JTabbedPane tabbedPane = new JTabbedPane();
roomsPanel = new TimeTablePanel<>();
tabbedPane.add("Rooms", new JScrollPane(roomsPanel));
personsPanel = new TimeTablePanel<>();
tabbedPane.add("Persons", new JScrollPane(personsPanel));
add(tabbedPane, BorderLayout.CENTER);
setPreferredSize(PREFERRED_SCROLLABLE_VIEWPORT_SIZE);
}
代码示例来源:origin: stackoverflow.com
final JTabbedPane tabbedPane = new JTabbedPane();
JButton addButton = new JButton("new");
addButton.addActionListener(new ActionListener() {
//will be called if the button gets clicked
@Override
public void actionPerformed(ActionEvent e) {
JPanel panel = new JPanel();//will be displayed in the Tab
tabbedPane.add("title", panel);
//.add() is the easier way for tabbedPane.insertTab(many arguments here)
//add what ever you like(repeat three times)
}
});
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
public void addColorChooserPanel(final AbstractColorChooserPanel ccp) {
final String displayName = ccp.getDisplayName();
if (displayName == null) {
// Return if we haven't initialized yet
return;
}
{
JPanel centerView = new JPanel(new BorderLayout());
centerView.add(ccp);
tabbedPane.add(centerView, displayName);
}
}
public void removeAllColorChooserPanels() {
代码示例来源:origin: javalite/jar-explorer
public LicenseDialog()
{
super(GUIUtil.getMainFrame(), "Licenses", true);
JTabbedPane tabbedPane = new JTabbedPane();
try
{
JEditorPane pane;
tabbedPane.add("JarExplorer", new JScrollPane(pane = new JEditorPane(getClass().getResource("/license.html"))));
pane.setEditable(false);
}
catch (Exception ignore){ignore.printStackTrace();}
try
{
JEditorPane pane;
tabbedPane.add("javad", new JScrollPane(pane = new JEditorPane("text/html", readResource("/javad/copyright.html"))));
pane.setEditable(false);
}
catch (Exception ignore){ignore.printStackTrace();}
getContentPane().add(tabbedPane);
setSize(new Dimension(800, 600));
}
代码示例来源:origin: igniterealtime/Smack
JTabbedPane tabbedPane = new JTabbedPane();
JPanel allPane = new JPanel();
allPane.setLayout(new GridLayout(3, 1));
tabbedPane.add("All", allPane);
sentText2.setForeground(new Color(112, 3, 3));
allPane.add(new JScrollPane(sentText1));
tabbedPane.add("Sent", new JScrollPane(sentText2));
receivedText2.setForeground(new Color(6, 76, 133));
allPane.add(new JScrollPane(receivedText1));
tabbedPane.add("Received", new JScrollPane(receivedText2));
interpretedText2.setForeground(new Color(1, 94, 35));
allPane.add(new JScrollPane(interpretedText1));
tabbedPane.add("Interpreted", new JScrollPane(interpretedText2));
menu.add(menuItem2);
frame.getContentPane().add(tabbedPane);
代码示例来源:origin: kiegroup/optaplanner
public TravelingTournamentPanel() {
awayMatchIcon = new ImageIcon(getClass().getResource("awayMatch.png"));
setLayout(new BorderLayout());
JTabbedPane tabbedPane = new JTabbedPane();
teamsPanel = new TimeTablePanel<>();
tabbedPane.add("Teams", new JScrollPane(teamsPanel));
add(tabbedPane, BorderLayout.CENTER);
setPreferredSize(PREFERRED_SCROLLABLE_VIEWPORT_SIZE);
}
内容来源于网络,如有侵权,请联系作者删除!