本文整理了Java中net.miginfocom.layout.LC.<init>()
方法的一些代码示例,展示了LC.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LC.<init>()
方法的具体详情如下:
包路径:net.miginfocom.layout.LC
类名称:LC
方法名:<init>
[英]Empty constructor.
[中]空构造函数。
代码示例来源:origin: stackoverflow.com
LC layoutConstraints = new LC();
layoutConstraints.setFillX(true);
super.setLayout(new MigLayout(layoutConstraints);
代码示例来源:origin: stackoverflow.com
LC lc_Y = (new LC()).fill().flowY();
lc_Y.setWrapAfter(ITEMS_PER_COLUMN);
JPanel panel = new JPanel(new MigLayout(lc_Y));
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) {
JPanel panel1 = new JPanel(new MigLayout(new LC().fill()));
panel1.add(new JTextField("text1"), "span, growx");
panel1.add(new JTextField("another text field"), "span, growx");
panel1.add(new JTextField("text3"), "span, growx");
JPanel panel2 = new JPanel(new MigLayout());
JTextArea textArea = new JTextArea();
textArea.setColumns(15);
textArea.setRows(7);
JScrollPane jsp = new JScrollPane(textArea);
panel2.add(jsp, "span, grow");
JFrame frame = new JFrame();
frame.setLayout(new GridLayout(1, 2));
frame.add(panel1);
frame.add(panel2);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
代码示例来源:origin: stackoverflow.com
JButton closeButton = new JButton("Close");
JButton mainMenuButton = new JButton("Menu");
JLabel labelTitle = new JLabel("Application");
JPanel panel = new JPanel();
panel.setLayout(new MigLayout(new LC().fillX()));
panel.add(labelTitle, new CC().alignX("center").spanX());
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new MigLayout(new LC().fillX()));
buttonPanel.add(closeButton, new CC().alignX("right").split());
buttonPanel.add(mainMenuButton, new CC().alignX("right"));
buttonPanel.setOpaque(false);
JXLayer<JPanel> mainPanel = new JXLayer<JPanel>();
mainPanel.setView(panel);
mainPanel.setGlassPane(buttonPanel);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(mainPanel);
frame.setSize(400, 600);
frame.setVisible(true);
代码示例来源:origin: stackoverflow.com
LC layoutConstraints = new LC();
layoutConstraints.setFillX(true);
layoutConstraints.setDebugMillis(500);
super.setLayout(new MigLayout(layoutConstraints);
代码示例来源:origin: stackoverflow.com
southPanel.setBackground(Color.YELLOW);
LC layoutContraints = new LC().wrapAfter(2)
.debug(1000);
AC columnContraints = new AC()
代码示例来源:origin: stackoverflow.com
panelCenter.setLayout(
new MigLayout(
new LC().wrapAfter(4),
new AC().size(":80:", 0).size("115:115:115", 1, 2, 3).align("right", 0, 2),
new AC().size("19:19:19")
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame("MigLayout");
JPanel panel = new JPanel(new MigLayout(new LC().debug(1000).flowY().fillX()));
代码示例来源:origin: joel-costigliola/assertj-examples
public void setMiglayout() {
setMiglayout(new LC(), new AC(), new AC());
}
代码示例来源:origin: Slowpoke101/FTBLaunch
cPnl = new JPanel();
rPnl = new JPanel();
lPnl.setLayout(new MigLayout(new LC().fillY()));
lPnl.add(enabledModsLbl, GuiConstants.WRAP);
lPnl.add(enabledModsScl, "pushy, " + GuiConstants.GROW + GuiConstants.SEP + GuiConstants.WRAP);
cPnl.add(enableMod, GuiConstants.WRAP);
cPnl.add(disableMod);
rPnl.setLayout(new MigLayout(new LC().fillY()));
rPnl.add(disabledModsLbl, GuiConstants.WRAP);
rPnl.add(disabledModsScl, "pushy, " + GuiConstants.GROW + GuiConstants.SEP + GuiConstants.WRAP);
rPnl.add(addMod, GuiConstants.FILL_SINGLE_LINE);
formPnl.setLayout(new MigLayout(new LC().fillY()));
formPnl.add(lPnl, "push, grow, " + GuiConstants.SPLIT_3);
formPnl.add(cPnl, "push, grow, center");
代码示例来源:origin: org.metawidget.modules/metawidget-all
LC layoutConstraints = new LC().insets( "0" );
代码示例来源:origin: joel-costigliola/assertj-examples
public SimpleFrame() {
setMiglayout(new LC().wrapAfter(1), new AC().align("center"), new AC());
JButton okButton = new JButton("OK");
okButton.setName("ok");
add(okButton);
pack();
}
}
代码示例来源:origin: eugener/oxbow
final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid()));
p.setOpaque(false);
for (final CommandLink link : choices)
代码示例来源:origin: org.metawidget.modules/metawidget-all
public void startContainerLayout( Composite container, SwtMetawidget metawidget ) {
container.setData( MigLayout.class.getName(), null );
State state = getState( container );
// The entire layout should fill both horizontally and vertically,
// with no insets. This allows us to be properly nested, as well as
// embedded within existing UIs, without alignment problems
LC layoutConstraints = new LC().insets( "0" );
// Debug Info (draws the red and blue lines)
if ( mDebugMode ) {
layoutConstraints.debug( 500 );
}
// Create the Layout
//
// Note: we don't use column/row constraints, because we don't know
// what the controls will be in advance. Rather, we use 'cell' and 'push'
org.eclipse.swt.widgets.Layout layout = new net.miginfocom.swt.MigLayout( layoutConstraints );
container.setLayout( layout );
// Calculate default label inset
//
// We top align all our labels, not just those belonging to 'tall' controls,
// so that tall controls, regular controls and nested Metawidget controls all line up.
// However, we still want the Labels to be middle aligned for one-line controls (such as
// Text boxes), so we top inset them a bit
state.defaultLabelVerticalPadding = new GC( container ).getFontMetrics().getLeading();
}
代码示例来源:origin: otros-systems/otroslogviewer
);
panel = new JPanel(new MigLayout(new LC().fill()));
model = new SpinnerNumberModel(12, 8, 30, 1);
代码示例来源:origin: joel-costigliola/assertj-examples
public TableFrame() {
setMiglayout(new LC().wrapAfter(1), new AC(), new AC());
final JTable table = newTable("records", data(), columns());
add(table);
pack();
}
代码示例来源:origin: joel-costigliola/assertj-examples
public MainFrame(String name) {
super("main");
setTitle("News: " + getTitle());
setMiglayout(new LC().wrapAfter(1), new AC().align("center"), new AC());
add(newLabel("name", "The user has the name: '" + name + "'"));
add(newLabel("pw", "and the password: '***"));
pack();
}
}
代码示例来源:origin: joel-costigliola/assertj-examples
public LoginFrame() {
setMiglayout(new LC().wrapAfter(2), new AC().align("right"), new AC());
final JLabel nameLabel = newLabel("username", "Username");
final JTextField textField = newTextField("username");
final JLabel pwLabel = newLabel("password", "Password");
final JTextField pwField = newPasswordField("password");
JButton loginButton = newButton("login", "Login");
loginButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
LoginFrame.this.dispose();
login(textField);
}
});
add(nameLabel);
add(textField);
add(pwLabel);
add(pwField);
add(loginButton);
pack();
}
代码示例来源:origin: com.miglayout/miglayout-javafx
if (layoutConstraints == null) setLayoutConstraints(new LC());
if (rowConstraints == null) setRowConstraints(new AC());
if (columnConstraints == null) setColumnConstraints(new AC());
代码示例来源:origin: joel-costigliola/assertj-examples
public SimpleCopyApplication() {
setMiglayout(new LC().wrapAfter(1), new AC().align("center"), new AC());
final JTextField textField = newTextField("textToCopy");
JButton button = newButton("copyButton", "Copy text to label");
final JLabel label = newLabel("copiedText");
addActionToButton(button, new Runnable() {
@Override
public void run() {
label.setText(textField.getText());
}
});
add(textField);
add(button);
add(label);
pack();
}
内容来源于网络,如有侵权,请联系作者删除!