本文整理了Java中javax.swing.JTabbedPane.setPreferredSize()
方法的一些代码示例,展示了JTabbedPane.setPreferredSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setPreferredSize()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setPreferredSize
暂无
代码示例来源:origin: SonarSource/sonarqube
tabbedPane.setPreferredSize(new Dimension(500, 7));
splitPane.setRightComponent(tabbedPane);
代码示例来源:origin: apache/pdfbox
public StringPane(COSString cosString)
{
tabbedPane = new JTabbedPane();
tabbedPane.setPreferredSize(new Dimension(300, 500));
tabbedPane.addTab(TEXT_TAB, createTextView(cosString));
tabbedPane.addTab(HEX_TAB, createHexView(cosString));
}
代码示例来源:origin: winder/Universal-G-Code-Sender
controlContextTabbedPane.setPreferredSize(new java.awt.Dimension(2000, 283));
controlContextTabbedPane.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
代码示例来源:origin: winder/Universal-G-Code-Sender
bottomTabbedPane.setPreferredSize(new java.awt.Dimension(468, 100));
代码示例来源:origin: triplea-game/triplea
public static JTabbedPane newJTabbedPane(final int width, final int height) {
final JTabbedPane tabbedPane = new JTabbedPaneWithFixedWidthTabs();
tabbedPane.setPreferredSize(new Dimension(width, height));
return tabbedPane;
}
代码示例来源:origin: net.imagej/imagej-ui-swing
public static JTabbedPane tab(final Component component, final String title,
final String tooltip, final int width, final int height,
final Container addTo)
{
final JPanel tab = new JPanel();
tab.setLayout(new BorderLayout());
tab.add(scrollPane(component, width, height, null), BorderLayout.CENTER);
final JTabbedPane tabbed = new JTabbedPane();
tabbed.addTab(title, null, tab, tooltip);
tabbed.setPreferredSize(new Dimension(width, height));
if (addTo != null) addTo.add(tabbed);
return tabbed;
}
代码示例来源:origin: sing-group/GC4S
public static void main(String[] args) {
JTabbedPane demoPanel = new CloseableJTabbedPane();
demoPanel.addTab("Tab 1", new JLabel("Tab 1"));
demoPanel.addTab("Tab 2", new JLabel("Tab 2"));
demoPanel.addTab("Tab 3", new JLabel("Tab 3"));
demoPanel.setPreferredSize(new Dimension(300,200));
showComponent(demoPanel, "CloseableJTabbedPane demo");
}
}
代码示例来源:origin: org.cytoscape/plugin-impl
public void stateChanged(ChangeEvent e){
int width = PluginManageDialog.this.jTabbedPane1.getSize().width;
if (PluginManageDialog.this.jTabbedPane1.getSelectedIndex() == 0){
PluginManageDialog.this.jTabbedPane1.setMinimumSize(new Dimension(width, 50));
PluginManageDialog.this.jTabbedPane1.setPreferredSize(new Dimension(width, 50));
PluginManageDialog.this.pnlSearch.setPreferredSize(new Dimension(width, 50));
PluginManageDialog.this.pnlSettings.setPreferredSize(new Dimension(width, 50));
}
else {
PluginManageDialog.this.jTabbedPane1.setMinimumSize(new Dimension(width, 150));
PluginManageDialog.this.jTabbedPane1.setPreferredSize(new Dimension(width, 150));
PluginManageDialog.this.pnlSearch.setPreferredSize(new Dimension(width, 150));
PluginManageDialog.this.pnlSettings.setPreferredSize(new Dimension(width, 150));
}
PluginManageDialog.this.pack();
}
}
代码示例来源:origin: protegeproject/protege
public OWLDataRangeEditor(OWLEditorKit owlEditorKit) {
editorPanel = new JPanel(new BorderLayout(7, 7));
tabbedPane = new JTabbedPane();
editorPanel.add(tabbedPane);
tabbedPane.add("Built in datatypes", datatypeList = new OWLDataTypeSelectorPanel(owlEditorKit));
expressionEditor = new ExpressionEditor<>(owlEditorKit, new OWLDataRangeChecker(owlEditorKit.getOWLModelManager()));
expressionScroller = new JScrollPane(expressionEditor);
tabbedPane.add("Data range expression", expressionScroller);
tabbedPane.setPreferredSize(new Dimension(400, 600));
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
public OWLDataRangeEditor(OWLEditorKit owlEditorKit) {
editorPanel = new JPanel(new BorderLayout(7, 7));
tabbedPane = new JTabbedPane();
editorPanel.add(tabbedPane);
tabbedPane.add("Built in datatypes", datatypeList = new OWLDataTypeSelectorPanel(owlEditorKit));
expressionEditor = new ExpressionEditor<OWLDataRange>(owlEditorKit, new OWLDataRangeChecker(owlEditorKit.getOWLModelManager()));
expressionScroller = new JScrollPane(expressionEditor);
tabbedPane.add("Data range expression", expressionScroller);
tabbedPane.setPreferredSize(new Dimension(400, 600));
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
public OWLDataRangeEditor(OWLEditorKit owlEditorKit) {
editorPanel = new JPanel(new BorderLayout(7, 7));
tabbedPane = new JTabbedPane();
editorPanel.add(tabbedPane);
tabbedPane.add("Built in datatypes", datatypeList = new OWLDataTypeSelectorPanel(owlEditorKit));
expressionEditor = new ExpressionEditor<>(owlEditorKit, new OWLDataRangeChecker(owlEditorKit.getOWLModelManager()));
expressionScroller = new JScrollPane(expressionEditor);
tabbedPane.add("Data range expression", expressionScroller);
tabbedPane.setPreferredSize(new Dimension(400, 600));
}
代码示例来源:origin: org.protege/protege-editor-owl
public OWLDataRangeEditor(OWLEditorKit owlEditorKit) {
editorPanel = new JPanel(new BorderLayout(7, 7));
tabbedPane = new JTabbedPane();
editorPanel.add(tabbedPane);
tabbedPane.add("Built in datatypes", datatypeList = new OWLDataTypeSelectorPanel(owlEditorKit));
expressionEditor = new ExpressionEditor<OWLDataRange>(owlEditorKit, new OWLDataRangeChecker(owlEditorKit.getOWLModelManager()));
expressionScroller = new JScrollPane(expressionEditor);
tabbedPane.add("Data range expression", expressionScroller);
tabbedPane.setPreferredSize(new Dimension(400, 600));
}
代码示例来源:origin: robo-code/robocode
/**
* When robotDialog is packed, we want to set a reasonable size. However,
* after that, we need a null preferred size so the scrollpane will scroll.
* (preferred size should be based on the text inside)
*/
@Override
public void pack() {
getConsoleScrollPane().setPreferredSize(new Dimension(426, 200));
super.pack();
getTabbedPane().setPreferredSize(null);
}
代码示例来源:origin: robo-code/robocode
/**
* When robotDialog is packed, we want to set a reasonable size. However,
* after that, we need a null preferred size so the scroll pane will scroll.
* (preferred size should be based on the text inside)
*/
@Override
public void pack() {
getConsoleScrollPane().setPreferredSize(new Dimension(426, 200));
super.pack();
getTabbedPane().setPreferredSize(null);
}
代码示例来源:origin: tulskiy/musique
public PlaylistTabs() {
setLayout(new BorderLayout());
tabbedPane = new JTabbedPane();
add(tabbedPane);
tabsVisible = true;
tabbedPane.setFocusable(false);
if (Util.isGTKLaF()) {
tabbedPane.setPreferredSize(new Dimension(10000, 30));
} else {
tabbedPane.setPreferredSize(new Dimension(10000, 25));
}
buildListeners();
createActions();
}
代码示例来源:origin: senbox-org/snap-desktop
private void initForm() {
form = new JTabbedPane();
//only add ioParametersPanel if there are input or target products
if(ioParametersPanel.getTargetProductSelectorDisplay() || ioParametersPanel.getSourceProductSelectorList().size() > 0) {
form.add("I/O Parameters", ioParametersPanel);
} else {
//if there is no ioParametersPanel, the size of the form could be too small
form.setPreferredSize(new Dimension(400, 300));
}
if (bindingContext.getPropertySet().getProperties().length > 0) {
final PropertyPane parametersPane = new PropertyPane(bindingContext);
final JPanel parametersPanel = parametersPane.createPanel();
parametersPanel.setBorder(new EmptyBorder(4, 4, 4, 4));
form.add("Processing Parameters", new JScrollPane(parametersPanel));
updateSourceProduct();
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
private void initializeTabs () {
tabbedPane = TabbedPaneFactory.createCloseButtonTabbedPane();
tabbedPane.addPropertyChangeListener(this);
tabbedPane.addTab(NbBundle.getMessage(CommitPanel.class, "CTL_CommitDialog_Tab_Commit"), basePanel); //NOI18N
tabbedPane.setPreferredSize(basePanel.getPreferredSize());
add(tabbedPane);
tabbedPane.addChangeListener(this);
}
代码示例来源:origin: protegeproject/protege
public ParseErrorsPanel(UnparsableOntologyException e, final URI loc) {
setLayout(new BorderLayout(12, 12));
tabs = new JTabbedPane();
tabs.setPreferredSize(new Dimension(700, 500));
final java.util.List<OWLParser> parsers = new ArrayList<>(e.getExceptions().keySet());
int counter = 1;
for (OWLParser parser : parsers){
Throwable parseError = e.getExceptions().get(parser);
ErrorExplainer.ErrorExplanation<? extends Throwable> explanation = errorExplainer.getErrorExplanation(parseError, true);
final ErrorPanel<? extends Throwable> errorPanel = new ParseErrorPanel<>(explanation, loc);
OWLDocumentFormatFactory supportedFormatFactory = parser.getSupportedFormat();
OWLDocumentFormat documentFormat = supportedFormatFactory.get();
tabs.addTab("(" + counter + ") " + documentFormat.getKey(), errorPanel);
counter++;
}
add(new JLabel("<html>Could not parse the ontology found at: " + loc +
"<p>The following formats were tried:</html>"), BorderLayout.NORTH);
add(tabs, BorderLayout.CENTER);
}
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
public ParseErrorsPanel(UnparsableOntologyException e, final URI loc) {
setLayout(new BorderLayout(12, 12));
tabs = new JTabbedPane();
tabs.setPreferredSize(new Dimension(700, 500));
final java.util.List<OWLParser> parsers = new ArrayList<>(e.getExceptions().keySet());
int counter = 1;
for (OWLParser parser : parsers){
Throwable parseError = e.getExceptions().get(parser);
ErrorExplainer.ErrorExplanation<? extends Throwable> explanation = errorExplainer.getErrorExplanation(parseError, true);
final ErrorPanel<? extends Throwable> errorPanel = new ParseErrorPanel<>(explanation, loc);
OWLDocumentFormatFactory supportedFormatFactory = parser.getSupportedFormat();
OWLDocumentFormat documentFormat = supportedFormatFactory.get();
tabs.addTab("(" + counter + ") " + documentFormat.getKey(), errorPanel);
counter++;
}
add(new JLabel("<html>Could not parse the ontology found at: " + loc +
"<p>The following formats were tried:</html>"), BorderLayout.NORTH);
add(tabs, BorderLayout.CENTER);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api
private void initializeCommitPane () {
if (tabbedPane == null) {
tabbedPane = TabbedPaneFactory.createCloseButtonTabbedPane();
tabbedPane.addPropertyChangeListener(this);
tabbedPane.addTab(modifier.getMessage(VCSCommitPanelModifier.BundleMessage.TABS_MAIN_NAME), basePanel);
tabbedPane.setPreferredSize(basePanel.getPreferredSize());
add(tabbedPane);
tabbedPane.addChangeListener(this);
}
}
内容来源于网络,如有侵权,请联系作者删除!