本文整理汇总了Java中javax.swing.JTabbedPane.add方法的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.add方法的具体用法?Java JTabbedPane.add怎么用?Java JTabbedPane.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTabbedPane
的用法示例。
在下文中一共展示了JTabbedPane.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HookPanel
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public HookPanel(VCSCommitPanel master, Collection<? extends VCSHook> hooks, VCSHookContext hookContext) {
super(master, (hooks.size() == 1)
? hooks.iterator().next().getDisplayName()
: getMessage("LBL_Advanced"), //NOI18N
DEFAULT_DISPLAY_HOOKS);
this.hooks = hooks;
this.hookContext = hookContext;
// need this to happen in addNotify() - depends on how
// repositoryComboSupport in hook.createComponents works for bugzilla|jira
if (hooks.size() == 1) {
JPanel p = hooks.iterator().next().createComponent(hookContext);
if (Boolean.TRUE.equals(p.getClientProperty("prop.requestOpened"))) { //NOI18N - some hook panels may want to be opened (hg queue hook with previously configured setts)
super.displaySection();
}
sectionPanel.add(p);
} else {
JTabbedPane hooksTabbedPane = new JTabbedPane();
for (VCSHook hook : hooks) {
hooksTabbedPane.add(hook.createComponent(hookContext), hook.getDisplayName().replaceAll("\\&", ""));
}
sectionPanel.add(hooksTabbedPane);
}
}
示例2: init
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
setLayout(new BorderLayout(0, 5));
setBorder(makeBorder());
// URL CONFIG
http2RequestPanel = new HTTP2RequestPanel(false, true, false);
// AdvancedPanel (embedded resources, source address and optional tasks)
JPanel advancedPanel = new VerticalPanel();
advancedPanel.add(createEmbeddedRsrcPanel());
advancedPanel.add(createSourceAddrPanel());
advancedPanel.add(createOptionalTasksPanel());
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add(JMeterUtils
.getResString("web_testing_basic"), http2RequestPanel);
tabbedPane.add(JMeterUtils
.getResString("web_testing_advanced"), advancedPanel);
JPanel emptyPanel = new JPanel();
emptyPanel.setMaximumSize(new Dimension());
add(makeTitlePanel(), BorderLayout.NORTH);
add(tabbedPane, BorderLayout.CENTER);
add(emptyPanel, BorderLayout.SOUTH);
}
示例3: getUpperInfoPanel
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
@Override
protected JComponent getUpperInfoPanel() {
JTabbedPane result = this.upperInfoPanel;
if (result == null) {
this.upperInfoPanel = result = new JTabbedPane();
result.add(getLabelPanel());
if (getResourceKind().hasProperties()) {
JComponent propertiesPanel = getPropertiesPanel();
JScrollPane scrollPanel = new JScrollPane(propertiesPanel);
scrollPanel.setName(propertiesPanel.getName());
scrollPanel.getViewport()
.setBackground(propertiesPanel.getBackground());
result.add(scrollPanel);
result.addChangeListener(createInfoListener(true));
}
}
if (getResourceKind().hasProperties()) {
result.setSelectedIndex(getDisplay().getInfoTabIndex(true));
}
return result;
}
示例4: buildTabs
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
* Build tabs for the exceptions
*
* @return JComponent
*/
private JComponent buildTabs() {
JTabbedPane tabs = new JTabbedPane();
for (Exception exception : exceptions) {
if (tabs.getTabCount() > EXCEPTION_LIMIT) {
tabs.add("And " + (exceptions.size() - EXCEPTION_LIMIT) + " more", Labels.create().icon(IconFactory.get().create("fa:frown-o")));
break;
}
tabs.add(exception.getClass().getSimpleName(), buildExceptionPane(exception));
}
return tabs;
}
示例5: createSyntaxHelp
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
* Creates the panel with documentation trees.
*/
private JTabbedPane createSyntaxHelp() {
JTabbedPane treePane = new JTabbedPane() {
@Override
public void setEnabled(boolean enabled) {
getGrooveTree().setEnabled(enabled);
getPrologTree().setEnabled(enabled);
getUserTree().setEnabled(enabled);
}
};
treePane.add("Groove", new JScrollPane(getGrooveTree()));
treePane.add("Prolog", new JScrollPane(getPrologTree()));
treePane.add("User", new JScrollPane(getUserTree()));
return treePane;
}
示例6: initComponents
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
JPanel butPane = new JPanel();
butPane.add(new JButton(close), BorderLayout.SOUTH);
cp.add(butPane, BorderLayout.SOUTH);
JTabbedPane jtp = new JTabbedPane();
JPanel general = new JPanel(new BorderLayout());
JLabel ghelp = new JLabel(generalHelp);
ghelp.setHorizontalAlignment(SwingConstants.CENTER);
ghelp.setVerticalAlignment(SwingConstants.CENTER);
JLabel icon = new JLabel(UIManager.getIcon("OptionPane.informationIcon"));
Box lbox = Box.createHorizontalBox();
lbox.add(Box.createHorizontalStrut(10));
lbox.add(icon);
lbox.add(Box.createHorizontalStrut(10));
general.add(ghelp, BorderLayout.CENTER);
general.add(lbox, BorderLayout.WEST);
general.add(Box.createHorizontalStrut(10), BorderLayout.EAST);
jtp.add("General", general);
JPanel evaluator = new JPanel(new BorderLayout());
HtmlPanel ehelp = new HtmlPanel(evalHelp);
evaluator.add(Box.createHorizontalStrut(10), BorderLayout.WEST);
evaluator.add(new JScrollPane(ehelp), BorderLayout.CENTER);
evaluator.add(Box.createHorizontalStrut(10), BorderLayout.EAST);
jtp.add("Evaluator", evaluator);
cp.add(jtp, BorderLayout.CENTER);
}
示例7: FullFrame
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public FullFrame(ThornsecModel model) {
JTabbedPane jtp = new JTabbedPane();
for (String network : model.getNetworkLabels()) {
jtp.add(network, getNetworkPane(model.getNetworkModel(network)));
}
JFrame frame = new JFrame("Thornsec");
frame.setExtendedState(frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(jtp);
frame.pack();
frame.setVisible(true);
}
示例8: getNetworkPane
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private Component getNetworkPane(NetworkModel model) {
JTabbedPane jtp = new JTabbedPane();
JTextArea area = new JTextArea();
area.setEditable(false);
TextAreaOutputStream out = new TextAreaOutputStream(area);
//jtp.add("Network Info", getInfoPanel(model));
jtp.add("Servers", getServerPanel(model, out));
jtp.add("Devices", getDevicePanel(model));
jtp.add("Output", getOutputPanel(area));
return jtp;
}
示例9: CoursePanel
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public CoursePanel() throws Exception
{
// this();
//jtp.setBounds(100, 100, 300, 200);
//jtp.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
//int ft_size=jtp.getFont().getSize();
setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
jtp = new JTabbedPane(JTabbedPane.TOP);
cap=new CourseAssignmentPanel();
cmp=new CourseMaterialPanel();
caup=new CourseAssignmentUploadPanel(null, "");
//cdfp=new CourseDiscussionForumPanel();
cip=new CourseInfoPanel();
jtp.add("Material", cmp);
jtp.setForegroundAt(0, Color.WHITE);
jtp.setBackgroundAt(0, Color.DARK_GRAY);
jtp.add("Assignments", cap);
jtp.setForegroundAt(1, Color.WHITE);
jtp.setBackgroundAt(1, Color.DARK_GRAY);
jtp.add("Upload Assignments", caup);
jtp.setForegroundAt(2, Color.WHITE);
jtp.setBackgroundAt(2, Color.DARK_GRAY);
//jtp.add("Discussion Forum", cdfp);
//jtp.setForegroundAt(3, Color.WHITE);
//jtp.setBackgroundAt(3, Color.DARK_GRAY);
jtp.add("Info", cip);
jtp.setForegroundAt(3, Color.WHITE);
jtp.setBackgroundAt(3, Color.BLACK);
cip.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
add(jtp);
}
示例10: setup
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
@Override
protected void setup()
{
scriptTab = new ScriptTab(changeDetector);
notificationsTab = new NotificationsTab(changeDetector, userService);
final JTabbedPane tabs = new JTabbedPane();
tabs.add(CurrentLocale.get("com.tle.admin.workflow.editor.scripteditor.details"), scriptTab);
tabs.add(CurrentLocale.get("com.tle.admin.workflow.editor.stepeditor.notifications"), notificationsTab);
setLayout(new GridLayout(1, 1));
add(tabs);
}
示例11: CrystalViewer
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public CrystalViewer() {
super(APP_NAME);
Space space = Space3D.getInstance();
sim = new Simulation(space);
center = space.makeVector();
species = new SpeciesSpheresMono(sim, space);
sim.addSpecies(species);
BasisMonatomic basisMonatomic = new BasisMonatomic(space);
BravaisLattice[] lattices = new BravaisLattice[] {
new LatticeCubicSimple(space),
new BravaisLatticeCrystal(new PrimitiveTetragonal(space), basisMonatomic),
new BravaisLatticeCrystal(new PrimitiveHexagonal(space), basisMonatomic),
new BravaisLatticeCrystal(new PrimitiveOrthorhombic(space), basisMonatomic),
new BravaisLatticeCrystal(new PrimitiveMonoclinic(space), basisMonatomic),
new BravaisLatticeCrystal(new PrimitiveTriclinic(space), basisMonatomic),
new LatticeCubicFcc(space),
new LatticeCubicBcc(space),
new LatticeHcp(space),
new LatticeCubicDiamond(space)
};
double[] boxSize = new double[] { 10.0, 10.0, 10.0 };
box = new Box(new BoundaryDeformableLattice(lattices[0].getPrimitive(),
boxSize), space);
sim.addBox(box);
String[] latticeNames = new String[]{
"Simple Cubic", "Tetragonal", "Hexagonal", "Orthorhombic", "Monoclinic", "Triclinic", "FCC", "BCC", "HCP", "Diamond"};
displayBox = new DisplayBox(sim, box);
displayBox.setPixelUnit(new Pixel(20));
displayBox.setResizeOnNewBox(false);
// we pass these to make LatticePlane happy. they'll get whacked by update() later
latticePlane = new LatticePlane(lattices[0].getPrimitive(), new int[] {1,0,0});
clipPlaneEditor = new ClipPlaneEditor(sim, latticePlane, displayBox);
latticeEditor = new LatticeEditor(this, lattices, latticeNames, space);
JTabbedPane controlTabs = new JTabbedPane();
controlTabs.add("Crystal", latticeEditor.getPanel());
controlTabs.add("Plane", clipPlaneEditor.getPanel());
controlPanel.add(controlTabs);
graphicsPanel.add(displayBox.graphic());
toolbar.addContributor("Colin Tedlock");
}
示例12: DefaultNumberAxisEditor
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
* Standard constructor: builds a property panel for the specified axis.
*
* @param axis the axis, which should be changed.
*/
public DefaultNumberAxisEditor(NumberAxis axis) {
super(axis);
this.autoRange = axis.isAutoRange();
this.minimumValue = axis.getLowerBound();
this.maximumValue = axis.getUpperBound();
this.gridPaintSample = new PaintSample(Color.blue);
this.gridStrokeSample = new StrokeSample(new BasicStroke(1.0f));
this.availableStrokeSamples = new StrokeSample[3];
this.availableStrokeSamples[0]
= new StrokeSample(new BasicStroke(1.0f));
this.availableStrokeSamples[1]
= new StrokeSample(new BasicStroke(2.0f));
this.availableStrokeSamples[2]
= new StrokeSample(new BasicStroke(3.0f));
JTabbedPane other = getOtherTabs();
JPanel range = new JPanel(new LCBLayout(3));
range.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
range.add(new JPanel());
this.autoRangeCheckBox = new JCheckBox(
localizationResources.getString("Auto-adjust_range"), this.autoRange
);
this.autoRangeCheckBox.setActionCommand("AutoRangeOnOff");
this.autoRangeCheckBox.addActionListener(this);
range.add(this.autoRangeCheckBox);
range.add(new JPanel());
range.add(
new JLabel(localizationResources.getString("Minimum_range_value"))
);
this.minimumRangeValue = new JTextField(
Double.toString(this.minimumValue)
);
this.minimumRangeValue.setEnabled(!this.autoRange);
this.minimumRangeValue.setActionCommand("MinimumRange");
this.minimumRangeValue.addActionListener(this);
this.minimumRangeValue.addFocusListener(this);
range.add(this.minimumRangeValue);
range.add(new JPanel());
range.add(
new JLabel(localizationResources.getString("Maximum_range_value"))
);
this.maximumRangeValue = new JTextField(
Double.toString(this.maximumValue)
);
this.maximumRangeValue.setEnabled(!this.autoRange);
this.maximumRangeValue.setActionCommand("MaximumRange");
this.maximumRangeValue.addActionListener(this);
this.maximumRangeValue.addFocusListener(this);
range.add(this.maximumRangeValue);
range.add(new JPanel());
other.add(localizationResources.getString("Range"), range);
}
示例13: EntitySetupFrame
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public EntitySetupFrame(EntitySetupController controller)
{
super("Entity Setup");
this.controller = controller;
if(Display.isVisible())
setLocation(Display.getX() + 10, Display.getY() + 40);
else
{
setLocationRelativeTo(null);
setLocation(50, 420);
}
addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e)
{
controller.close();
}
});
JButton doneButton = new JButton("Done");
doneButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent arg0)
{
controller.close();
}
});
partPanel = new EntitySetupPartPanel(controller);
parentingPanel = new EntitySetupParentingPanel(controller);
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add("Part Setup", partPanel);
tabbedPane.add("Parenting", parentingPanel);
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5,5,5,5);
c.gridx = 0;
c.gridy = 0;
mainPanel.add(tabbedPane,c);
c.gridx = 0;
c.gridy = 1;
mainPanel.add(doneButton, c);
setContentPane(mainPanel);
pack();
setResizable(false);
setAlwaysOnTop(true);
}
示例14: initGui
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
* Initialisiert das Gui
*
*/
private void initGui()
{
// setBounds(100, 100, 450, 300);
setPreferredSize(new Dimension(1920, 1080));
setMinimumSize(new Dimension(600, 400));
setExtendedState(JFrame.MAXIMIZED_BOTH);
addWindowListener(new ActionHandler());
tabPane = new JTabbedPane();
tabPane.addChangeListener(new ActionHandler());
initWeekPane(7, 24);
workweek = new JPanel();
workweek.add(new JLabel("Coming soon!"));
tabPane.addTab("Arbeitswoche", workweek);
JPanel bottomPanel = new JPanel();
GroupLayout groupLayout = new GroupLayout(getContentPane());
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
.createSequentialGroup().addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(tabPane, GroupLayout.DEFAULT_SIZE, 1831, Short.MAX_VALUE).addGap(12))
.addComponent(bottomPanel, GroupLayout.DEFAULT_SIZE, 1843, Short.MAX_VALUE))));
groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
groupLayout.createSequentialGroup().addContainerGap()
.addComponent(tabPane, GroupLayout.DEFAULT_SIZE, 978, Short.MAX_VALUE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(bottomPanel, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)));
bottomPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
JButton back = new JButton(" ");
back.setIcon(new StretchIcon(CalendarFrame.class.getResource("/gfx/back.png")));
bottomPanel.add(back);
JButton next = new JButton(" ");
next.setIcon(new StretchIcon(CalendarFrame.class.getResource("/gfx/next.png")));
bottomPanel.add(next);
month = new JPanel();
tabPane.add("Monat", month);
getContentPane().setLayout(groupLayout);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu datei = new JMenu("Datei");
menuBar.add(datei);
}
示例15: NumberAxisPropertyEditPanel
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
* Standard constructor: builds a property panel for the specified axis.
*
* @param axis the axis, which should be changed.
*/
public NumberAxisPropertyEditPanel(NumberAxis axis) {
super(axis);
this.autoRange = axis.isAutoRange();
this.minimumValue = axis.getLowerBound();
this.maximumValue = axis.getUpperBound();
this.gridPaintSample = new PaintSample(Color.blue);
this.gridStrokeSample = new StrokeSample(new BasicStroke(1.0f));
this.availableStrokeSamples = new StrokeSample[3];
this.availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f));
this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f));
this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f));
JTabbedPane other = getOtherTabs();
JPanel range = new JPanel(new LCBLayout(3));
range.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
range.add(new JPanel());
this.autoRangeCheckBox = new JCheckBox(localizationResources.getString("Auto-adjust_range"),
this.autoRange);
this.autoRangeCheckBox.setActionCommand("AutoRangeOnOff");
this.autoRangeCheckBox.addActionListener(this);
range.add(this.autoRangeCheckBox);
range.add(new JPanel());
range.add(new JLabel(localizationResources.getString("Minimum_range_value")));
this.minimumRangeValue = new JTextField(Double.toString(this.minimumValue));
this.minimumRangeValue.setEnabled(!this.autoRange);
this.minimumRangeValue.setActionCommand("MinimumRange");
this.minimumRangeValue.addActionListener(this);
this.minimumRangeValue.addFocusListener(this);
range.add(this.minimumRangeValue);
range.add(new JPanel());
range.add(new JLabel(localizationResources.getString("Maximum_range_value")));
this.maximumRangeValue = new JTextField(Double.toString(this.maximumValue));
this.maximumRangeValue.setEnabled(!this.autoRange);
this.maximumRangeValue.setActionCommand("MaximumRange");
this.maximumRangeValue.addActionListener(this);
this.maximumRangeValue.addFocusListener(this);
range.add(this.maximumRangeValue);
range.add(new JPanel());
other.add(localizationResources.getString("Range"), range);
// JPanel grid = new JPanel(new LCBLayout(3));
// grid.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
// grid.add(new JPanel());
// showGridLinesCheckBox = new JCheckBox("Show grid lines",
// axis.isGridLinesVisible());
// grid.add(showGridLinesCheckBox);
// grid.add(new JPanel());
// grid.add(new JLabel("Grid stroke:"));
// JButton button = new JButton("Set stroke...");
// button.setActionCommand("GridStroke");
// button.addActionListener(this);
// grid.add(gridStrokeSample);
// grid.add(button);
// grid.add(new JLabel("Grid paint:"));
// button = new JButton("Set paint...");
// button.setActionCommand("GridPaint");
// button.addActionListener(this);
// grid.add(gridPaintSample);
// grid.add(button);
// other.add("Grid", grid);
}