javax.swing.Box.setPreferredSize()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(183)

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

Box.setPreferredSize介绍

暂无

代码示例

代码示例来源:origin: antlr/antlrworks

private void createStatusBar() {
  infoLabel = new JLabel();
  cursorLabel = new JLabel();
  writableLabel = new JLabel();
  consoleStatus = new ConsoleStatus();
  memoryStatus = new GrammarMemoryStatus();
  statusBar = new GrammarStatusBar();
  statusBar.setPreferredSize(new Dimension(0, 30));
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(infoLabel);
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(createSeparator());
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(cursorLabel);
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(createSeparator());
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(writableLabel);
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(createSeparator());
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(consoleStatus.getPanel());
  statusBar.add(Box.createHorizontalStrut(5));
  statusBar.add(createSeparator());
  statusBar.add(Box.createHorizontalGlue());
  statusBar.add(memoryStatus);
}

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

f.add(createPanel("Actuator status"), BorderLayout.WEST);
f.add(createPanel("Indicator result"), BorderLayout.EAST);
...
private Box createPanel(String s) {
  Box box = new Box(BoxLayout.Y_AXIS);
  TitledBorder title = BorderFactory.createTitledBorder(null, s,
    TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION);
  box.setBorder(title);
  for (int i = 0; i < 6; i++) {
    JButton b = new JButton(null, UIManager.getIcon("html.pendingImage"));
    b.setAlignmentX(JButton.CENTER_ALIGNMENT);
    box.add(b);
  }
  box.validate();
  Dimension db = box.getPreferredSize();
  int max = Math.max(title.getMinimumSize(box).width, db.width);
  box.setPreferredSize(new Dimension(max, db.height));
  return box;
}

代码示例来源:origin: de.sciss/prefuse-core

m_sbox.setBorder(null);
m_sbox.setMaximumSize(new Dimension(400, 100));
m_sbox.setPreferredSize(new Dimension(171, 20));

代码示例来源:origin: cmu-phil/tetrad

dataLoadingIndicatorBox.setPreferredSize(new Dimension(200, 60));

代码示例来源:origin: cmu-phil/tetrad

topBox.setPreferredSize(new Dimension(820, 400));
bottomBox.setPreferredSize(new Dimension(820, 150));

代码示例来源:origin: eu.mihosoft.vrl/vrl

private void initialize() {
  setStyle(createGroupStyle());
  Box box = Box.createVerticalBox();
  add(box);
  box.setMinimumSize(new Dimension(200, 120));
  box.setPreferredSize(new Dimension(200, 120));
  Component c = Box.createGlue();
  c.setSize(160, 100);
  c.setMinimumSize(new Dimension(160, 100));
  final ResizableContainer rc = new ResizableContainer(c, this);
  box.add(rc);
}

代码示例来源:origin: pl.touk/test-generator

buttonBox.add(createApplyToAllButton());
buttonBox.add(Box.createHorizontalStrut(10));
buttonBox.setPreferredSize(new Dimension(Integer.MAX_VALUE, 30));

代码示例来源:origin: cmu-phil/tetrad

caseIdProvidedLabelBox.setPreferredSize(labelSize);
caseIdProvidedLabelBox.add(new JLabel("Case ID column to ignore:"));
caseIdProvidedOption1Box.setPreferredSize(new Dimension(160, 30));
caseIdProvidedOption1Box.add(idNoneRadioButton);
caseIdProvidedOption2Box.setPreferredSize(new Dimension(160, 30));
caseIdProvidedOption2Box.add(idUnlabeledFirstColRadioButton);
caseIdProvidedOption3Box.setPreferredSize(new Dimension(300, 30));
caseIdProvidedOption3Box.add(idLabeledColRadioButton);
caseIdProvidedOption3Box.add(idStringField);
commentMarkerLabelBox.setPreferredSize(labelSize);
commentMarkerLabelBox.add(new JLabel("Comment marker:"));
commentMarkerOption1Box.setPreferredSize(new Dimension(160, 30));
commentMarkerOption1Box.add(commentDoubleSlashRadioButton);
commentMarkerOption2Box.setPreferredSize(new Dimension(160, 30));
commentMarkerOption2Box.add(commentPondRadioButton);
commentMarkerOption3Box.setPreferredSize(new Dimension(260, 30));
commentMarkerOption3Box.add(commentOtherRadioButton);
commentMarkerOption3Box.add(commentStringField);
quoteCharLabelBox.setPreferredSize(labelSize);
quoteCharLabelBox.add(new JLabel("Quote character:"));

代码示例来源:origin: cmu-phil/tetrad

fileTypeLabelBox.setPreferredSize(labelSize);
fileTypeLabelBox.add(new JLabel("File type:"));
fileTypeOption1Box.setPreferredSize(new Dimension(160, 30));
fileTypeOption1Box.add(tabularRadioButton);
fileTypeOption2Box.setPreferredSize(new Dimension(300, 30));
fileTypeOption2Box.add(covarianceRadioButton);
dataTypeLabelBox.setPreferredSize(labelSize);
dataTypeLabelBox.add(new JLabel("Data type:"));
dataTypeOption1Box.setPreferredSize(new Dimension(160, 30));
dataTypeOption1Box.add(contRadioButton);
dataTypeOption2Box.setPreferredSize(new Dimension(160, 30));
dataTypeOption2Box.add(discRadioButton);
dataTypeOption3Box.setPreferredSize(new Dimension(320, 30));
dataTypeOption3Box.add(mixedRadioButton);
valueDelimiterLabelBox.setPreferredSize(labelSize);
valueDelimiterLabelBox.add(new JLabel("Value delimiter:"));
valueDelimiterOption1Box.setPreferredSize(new Dimension(160, 30));
valueDelimiterOption1Box.add(whitespaceDelimiterRadioButton);
valueDelimiterOption2Box.setPreferredSize(new Dimension(300, 30));
valueDelimiterOption2Box.add(singleCharDelimiterRadioButton);

代码示例来源:origin: cmu-phil/tetrad

topBox.setPreferredSize(new Dimension(820, 400));
bottomBox.setPreferredSize(new Dimension(750, 150));

代码示例来源:origin: cmu-phil/tetrad

topBox.setPreferredSize(new Dimension(820, 400));
bottomBox.setPreferredSize(new Dimension(750, 150));

代码示例来源:origin: cmu-phil/tetrad

topBox.setPreferredSize(new Dimension(820, 400));
bottomBox.setPreferredSize(new Dimension(750, 150));

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public void enterFullScreenMode(Dimension size) {
  super.enterFullScreenMode(size);
  previousPlotPaneSize = plotPane.getSize();
  container.setPreferredSize(new Dimension(Short.MAX_VALUE,Short.MAX_VALUE));
  container.setMinimumSize(null);
  container.setMaximumSize(null);
  plotPane.setPreferredSize(null);
  plotPane.setMinimumSize(null);
  plotPane.setMaximumSize(null);
  revalidate();
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public void enterFullScreenMode(Dimension size) {
  super.enterFullScreenMode(size);
  previousPlotPaneSize = plotPane.getSize();
  container.setPreferredSize(new Dimension(Short.MAX_VALUE,Short.MAX_VALUE));
  container.setMinimumSize(null);
  container.setMaximumSize(null);
  plotPane.setPreferredSize(null);
  plotPane.setMinimumSize(null);
  plotPane.setMaximumSize(null);
  revalidate();
}

代码示例来源:origin: cmu-phil/tetrad

topBox.setPreferredSize(new Dimension(820, 400));
bottomBox.setPreferredSize(new Dimension(750, 150));

代码示例来源:origin: cmu-phil/tetrad

container.setPreferredSize(new Dimension(900, 590));
previewContainer.setPreferredSize(new Dimension(900, 250));

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public void leaveFullScreenMode() {
  super.leaveFullScreenMode();
  container.setPreferredSize(null);
  container.setMinimumSize(null);
  container.setMaximumSize(null);
  
  plotPane.setSize(previousPlotPaneSize);
  plotPane.setPreferredSize(previousPlotPaneSize);
  plotPane.setMinimumSize(minimumPlotPaneSize);
  
  revalidate();
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public void leaveFullScreenMode() {
  super.leaveFullScreenMode();
  container.setPreferredSize(null);
  container.setMinimumSize(null);
  container.setMaximumSize(null);
  
  plotPane.setSize(previousPlotPaneSize);
  plotPane.setPreferredSize(previousPlotPaneSize);
  plotPane.setMinimumSize(minimumPlotPaneSize);
  
  revalidate();
}

代码示例来源:origin: openpreserve/jhove

_mainBox.setPreferredSize (new Dimension (400, maxHeight));

代码示例来源:origin: eu.mihosoft.vrl/vrl

iconBox.add(closeIcon);
iconBox.add(Box.createVerticalGlue());
iconBox.setPreferredSize(new Dimension(iconBoxSize, iconBoxSize));
iconBox.setMinimumSize(iconBox.getPreferredSize());
this.add(iconBox);

相关文章