本文整理了Java中javax.swing.SpringLayout.<init>()
方法的一些代码示例,展示了SpringLayout.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SpringLayout.<init>()
方法的具体详情如下:
包路径:javax.swing.SpringLayout
类名称:SpringLayout
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
SpringLayout layout = new SpringLayout();
代码示例来源:origin: stackoverflow.com
String[] labels = {"Name: ", "Fax: ", "Email: ", "Address: "};
int numPairs = labels.length;
//Create and populate the panel.
JPanel p = new JPanel(new SpringLayout());
for (int i = 0; i < numPairs; i++) {
JLabel l = new JLabel(labels[i], JLabel.TRAILING);
p.add(l);
JTextField textField = new JTextField(10);
l.setLabelFor(textField);
p.add(textField);
}
//Lay out the panel.
SpringUtilities.makeCompactGrid(p,
numPairs, 2, //rows, cols
6, 6, //initX, initY
6, 6); //xPad, yPad
代码示例来源:origin: opensourceBIM/BIMserver
JPanel fields = new JPanel(new SpringLayout());
代码示例来源:origin: stackoverflow.com
SpringLayout layout = new SpringLayout();
setLayout(layout);
...
add(_button);
...
layout.putConstraint(SpringLayout.EAST, _button, -20, SpringLayout.EAST, this);
layout.putConstraint(SpringLayout.SOUTH, _button, -20, SpringLayout.SOUTH, this);
代码示例来源:origin: stackoverflow.com
JPanel status = new JPanel( new SpringLayout() ) {
@Override
public Dimension getMaximumSize() {
Dimension max = super.getMaximumSize();
Dimension min = getMinimumSize();
return new Dimension( max.width, min.height );
}
};
代码示例来源:origin: stackoverflow.com
final JPanel panel = new JPanel(new SpringLayout()) {
@Override
public Dimension getPreferredSize() {
return new Dimension(300, 300);
}
};
// add stuff to panel here
final JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
add(scrollPane);
代码示例来源:origin: stackoverflow.com
final JPanel panel = new JPanel(new SpringLayout());
// add stuff to panel here
final JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setPreferredSize(new Dimension(300, 300));
add(scrollPane);
代码示例来源:origin: stackoverflow.com
JPanel contentPane = new JPanel(new SpringLayout());
//...
contentPane.add(makeWrapper(label));
//...
private static JComponent makeWrapper(JComponent c) {
JPanel p = new JPanel(new BorderLayout());
p.add(c, BorderLayout.NORTH);
return p;
}
代码示例来源:origin: de.sciss/scisslib
/**
* Creates a new panel with zero padding and offset
*/
public SpringPanel()
{
super();
layout = new SpringLayout();
setLayout( layout );
}
代码示例来源:origin: stackoverflow.com
JPanel panel = new JPanel();
SpringLayout panelLayout = new SpringLayout();
panel.setLayout(panelLayout);
// Adding components to the panel here
// .....
// That's what defines panel's exact size and makes its scrolling possible
panelLayout.putConstraint(SpringLayout.SOUTH, panel, 0,
SpringLayout.SOUTH, lastComponentOfThePanel);
JScrollPane panelScrollPane = new JScrollPane(panel);
代码示例来源:origin: stackoverflow.com
SpringLayout springLayout = new SpringLayout();
Container cont = getContentPane();
cont.setLayout(springLayout);
JLabel label = new JLabel("New label");
springLayout.putConstraint(SpringLayout.WEST, label, 20, SpringLayout.WEST, cont);
springLayout.putConstraint(SpringLayout.SOUTH, label, -10, SpringLayout.SOUTH, cont);
cont.add(lblNewLabel);
代码示例来源:origin: senbox-org/snap-desktop
private JPanel createPreProcessingTab() {
JPanel preprocessAndPatternsPanel = new JPanel(new SpringLayout());
preprocessAndPatternsPanel.add(createPreProcessingPanel());
SpringUtilities.makeCompactGrid(preprocessAndPatternsPanel, 1, 1,
DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
preprocessAndPatternsPanel.setMaximumSize(preprocessAndPatternsPanel.getSize());
return preprocessAndPatternsPanel;
}
代码示例来源:origin: stackoverflow.com
SpringLayout layout = new SpringLayout();
JPanel contentPane = new JPanel(layout); // <-- Add the layout manager.
JTextPane txtpnHello = new JTextPane();
// The "Spring" for right
layout.putConstraint(SpringLayout.EAST, txtpnHello, 5,
SpringLayout.EAST, contentPane);
// The "spring" for the bottom.
layout.putConstraint(SpringLayout.SOUTH, txtpnHello, 5,
SpringLayout.SOUTH, contentPane);
txtpnHello.setText("Hello");
txtpnHello.setEnabled(false);
contentPane.add(txtpnHello);
代码示例来源:origin: com.github.danielpacak.osgi.swingconsole/osgi.swingconsole
/**
* Creates an empty form.
*/
public AttributesForm() {
conversionService = new AttributeValueConversionService(new DefaultConversionService());
form = new JPanel(new SpringLayout());
formFields = new LinkedList<AttributeFormField>();
setLayout(new BorderLayout());
add(form, BorderLayout.NORTH);
}
代码示例来源:origin: stackoverflow.com
SpringLayout layout = new SpringLayout();
// For Horizontal Alignment
layout.putConstraint(SpringLayout.HORIZONTAL_CENTER, component, 0, SpringLayout.HORIZONTAL_CENTER, contentPane);
// For Vertical Alignment
layout.putConstraint(SpringLayout.VERTICAL_CENTER, component, 0, SpringLayout.VERTICAL_CENTER, contentPane);
setLayout(layout);
代码示例来源:origin: it.unibo.alchemist/alchemist-swingui
/**
*
*/
public JTapeMainFeature() {
super();
setBackground(Color.YELLOW);
springLayout = new SpringLayout();
setLayout(springLayout);
}
代码示例来源:origin: MrCrayfish/ModelCreator
public DisplayEntryPanel(DisplayProperties.Entry entry)
{
this.entry = entry;
this.setPreferredSize(new Dimension(200, 345));
this.setLayout(new SpringLayout());
this.initComponents();
}
代码示例来源:origin: MrCrayfish/ModelCreator
public SidebarPanel(ModelCreator creator)
{
this.creator = creator;
this.setLayout(layout = new SpringLayout());
this.setPreferredSize(new Dimension(200, 760));
this.initComponents();
this.setLayoutConstaints();
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
protected JPanel createPatternsPanel() {
JPanel patternsPanel = new JPanel(new SpringLayout());
patternsPanel.setBorder(BorderFactory.createTitledBorder(Bundle.CTL_Panel_OutputPattern_Border_TitleText()));
TextFieldEditor textEditor = new TextFieldEditor();
addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ProgressPattern(), ToolAdapterConstants.PROGRESS_PATTERN, false, null);
propertyContainer.getDescriptor(ToolAdapterConstants.PROGRESS_PATTERN).setValidator(new RegexFieldValidator());
addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ErrorPattern(), ToolAdapterConstants.ERROR_PATTERN, false, null);
propertyContainer.getDescriptor(ToolAdapterConstants.ERROR_PATTERN).setValidator(new RegexFieldValidator());
SpringUtilities.makeCompactGrid(patternsPanel, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
return patternsPanel;
}
代码示例来源:origin: Killerardvark/CryodexSource
private AboutPanel(JDialog parent) {
super(new SpringLayout());
this.parent = parent;
String aboutText = "<HTML>This program was created for the Campaign Against Cancer Tournament. A special thanks to Chad Hoefle and Anthony Lullig for their encouragement and testing during that time. I would also like to thank all of those who encouraged me to make it better and distribute it after that tournament was complete. My goal is to have a program that #1 follows the rules and #2 is easy to use. You are welcome to contact me with any comments or concerns you have about the program. My email is Chris.Brown.SPE@gmail.com. You can also use that email to send a donation via Paypal if you feel so inclined.</HTML>";
JLabel aboutLabel = new JLabel(aboutText);
ComponentUtils.forceSize(aboutLabel, 400, 175);
this.add(aboutLabel);
this.add(ComponentUtils.addToFlowLayout(getCloseButton(),
FlowLayout.CENTER));
SpringUtilities.makeCompactGrid(this, this.getComponentCount(), 1, 1,
1, 1, 1);
}
内容来源于网络,如有侵权,请联系作者删除!