net.miginfocom.swing.MigLayout.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(76)

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

MigLayout.<init>介绍

[英]Constructor with no constraints.
[中]没有约束的构造函数。

代码示例

代码示例来源:origin: geotools/geotools

public JComponent doLayout() {
  final JPanel panel = new JPanel(new MigLayout("insets 0"));
  panel.add(field = new JTextField(32), "width 200::700, growx");
  // field.setActionCommand(FINISH); // pressing return will Finish wizard
  panel.add(browse = new JButton("Browse"), "wrap");
  browse.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          browse();
        }
      });
  return panel;
}

代码示例来源:origin: geotools/geotools

@Override
public JPanel createControlPanel() {
  JPanel panel = new JPanel(new MigLayout());
  panel.add(new JLabel(DECIMAL_DIALOG_LABEL), "gap related");
  digitsFld = new JIntegerField(numDigits, false);
  panel.add(digitsFld, "w 40!");
  return panel;
}

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

val panel = new JPanel(new MigLayout("debug", 
       "[grow 25][grow 50][grow 25]","grow" ))
panel.add(new JPanel)
panel.add(new JPanel, "spany 2")
panel.add(new JPanel, "wrap")
panel.add(new JPanel)
panel.add(new JPanel)

代码示例来源:origin: winder/Universal-G-Code-Sender

setLayout(new MigLayout("flowy, hidemode 3"));
add(openCloseButton, "wmin button, grow, flowx, split 3");
add(sendPauseResumeButton, "r, wmin button, grow");
add(browseCancelButton, "r, wmin button, grow");
connection.setLayout(new MigLayout("fill, wrap 3"));
connection.add(portLabel, "al right");
connection.add(portCombo, "span 3");
connection.add(baudLabel, "al right");
connection.add(baudCombo);
connection.add(refreshButton);

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

MigLayout layout = new MigLayout("debug, fillx", "[][grow][]");
JPanel content = new JPanel(layout);
// First row        
content.add(new JTextField(20), "spanx 2, growx"); // search text field
content.add(new JButton("Search"), "wrap");
// Second row
content.add(new JButton("Button # 1"), "growx");
content.add(new JLabel("Image here"), "span 2 3, grow, wrap"); // image label
content.add(new JButton("Button # 2"), "growx, wrap");
content.add(new JButton("Button # 3"), "growx, wrap");

代码示例来源:origin: winder/Universal-G-Code-Sender

public Spinner(String text, SpinnerModel model) {
  label = new JLabel(text);
  spinner = new JSpinner(model);
  setLayout(new MigLayout("insets 0, wrap 2"));
  add(spinner, "w 70");
  add(label);
}

代码示例来源:origin: org.gephi/datalab-plugin

public void loadSettings() {
  JPanel settingsPanel = new JPanel();
  settingsPanel.setLayout(new MigLayout("fillx"));
  loadDescription(settingsPanel);
  loadBaseColumn(settingsPanel);
  loadDeleteMergedNodesCheckBox(settingsPanel);
  scroll.setViewportView(settingsPanel);
  refreshDuplicatesAndStrategies();
}

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

JPanel pnl = new JPanel(new MigLayout("wrap"));
pnl.add(field, "pushx, growx");
pnl.add(new JScrollPane(area), "push, grow");
add(pnl);

代码示例来源:origin: Slowpoke101/FTBLaunch

private void setupGui () {
    setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/image/logo_ftb.png")));
    setTitle(I18N.getLocaleString("PASSWORD_TITLE"));
    setResizable(true);

    Container panel = getContentPane();
    panel.setLayout(new MigLayout());

    passwordLbl = new JLabel(I18N.getLocaleString("PASSWORD_PASSLABEL"));
    password = new JPasswordField(16);
    login = new JButton(I18N.getLocaleString("MAIN_SUBMIT"));

    panel.add(passwordLbl);
    panel.add(password, GuiConstants.WRAP);
    panel.add(login, GuiConstants.CENTER_SINGLE_LINE);

    pack();
    setLocationRelativeTo(getOwner());
  }
}

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

public class MyView{
 private MyPresentationModel model;

 private JButton okButton;
 private JButton cancelButton;
 ...

 public MyView(MyPresentationModel model){
  this.model = model;
 }

 public JPanel buildView(){
  initComponents(); // this method actually creates the okButton and cancelButton objects
  bindComponentsToModel(); // this method binds those objects to the PresentationModel
  JPanel p = new JPanel(new MigLayout());
  p.add(...);
  ...
  return p;
 }
}

代码示例来源:origin: Slowpoke101/FTBLaunch

private void setupGui () {
    setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/image/logo_ftb.png")));
    setTitle("Text Search Filter");
    setResizable(true);

    Container panel = getContentPane();
    panel.setLayout(new MigLayout());

    panel.add(query, GuiConstants.FILL_SINGLE_LINE);

    pack();
    setLocationRelativeTo(getOwner());
  }
}

代码示例来源:origin: geotools/geotools

public JPanel createPanel() {
  final JPanel page = super.createPanel();
  page.setLayout(new MigLayout());
  JLabel title = new JLabel("Choose DataStore");
  Font titleFont = new Font("Arial", Font.BOLD, 14);
  title.setFont(titleFont);
  page.add(title, "span");
  JLabel description = new JLabel("Available DataStores on your classpath");
  page.add(description, "grow, span");
  scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  scroll.setPreferredSize(new Dimension(300, 100));
  page.add(scroll, "growx,growy,span");

代码示例来源:origin: winder/Universal-G-Code-Sender

MigLayout layout = new MigLayout("fillx, wrap " + columns + ", inset " + INSET, columnConstraint.toString());
macroPanel.setLayout(layout);
  macroPanel.add(button, "cell " + x +  " " + y);
  y++;
  if (y == rows) {

代码示例来源:origin: geotools/geotools

public JComponent doLayout() {
  final JPanel panel = new JPanel(new MigLayout("insets 0"));
  panel.add(field = new JTextField(32), "width 200::700, growx");
  // field.setActionCommand(FINISH); // pressing return will Finish wizard
  panel.add(browse = new JButton("Browse"), "wrap");
  browse.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          browse();
        }
      });
  return panel;
}

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

public void mainWindow() {

  log.info("enter mainWindow method");

  MigLayout layout = new MigLayout("fillx", "[right]rel[grow,fill]", "[]10[]");
  JPanel panel = new JPanel(layout);

  panel.add(new JLabel("Enter size:"),"");
  panel.add(new JTextField(""),"wrap");
  panel.add(new JLabel("Enter weight:"),"");
  panel.add(new JTextField(""),"");

}

代码示例来源:origin: winder/Universal-G-Code-Sender

this.setLayout(new MigLayout("wrap 4"));
this.add(rapidRadio, "wrap");
this.add(new JLabel(FEED_SHORT + ":"));
this.add(feedSpeed);
this.add(adjust1);
this.add(adjust2);
this.add(new JLabel(SPINDLE_SHORT + ":"));
this.add(spindleSpeed);
this.add(adjust3, "span 2");
this.add(new JLabel("Rapid:"));
this.add(rapidSpeed);
this.add(adjust4);

代码示例来源:origin: org.gephi/datalab-plugin

public void loadSettings() {
  JPanel settingsPanel = new JPanel();
  settingsPanel.setLayout(new MigLayout("fillx"));
  loadDescription(settingsPanel);
  loadDeleteMergedNodesCheckBox(settingsPanel);
  loadSelectedRow(settingsPanel);
  loadColumnsStrategies(settingsPanel);
  scroll.setViewportView(settingsPanel);
}

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

JPanel pnl = new JPanel(new MigLayout("wrap", "[grow]", "[][grow]"));
pnl.add(field, "growx");
pnl.add(new JScrollPane(area), "grow");
add(pnl);

代码示例来源:origin: winder/Universal-G-Code-Sender

public MacroPanel(BackendAPI backend) {
  super(new MigLayout("fillx, wrap 4", "[fill, sg 1]r[fill, grow 10]r[fill, grow 45]r[fill, grow 45]"));
  if (backend == null) {
    throw new RuntimeException();
  }
  this.backend = backend;
  backend.addUGSEventListener(this);
  addListeners();
  buttonPanel.add(helpButton, "grow");
  buttonPanel.add(importButton, "grow");
  buttonPanel.add(exportButton, "grow");
}

代码示例来源:origin: geotools/geotools

@Override
public JPanel createPanel() {
  final JPanel page = super.createPanel();
  page.setLayout(new MigLayout());
  JLabel titleLabel = new JLabel(this.title);
  Font titleFont = new Font("Arial", Font.BOLD, 14);
  titleLabel.setFont(titleFont);
  page.add(titleLabel, "span");
  if (this.description != null) {
    JLabel descLabel = new JLabel(this.description);
    page.add(descLabel, "grow, span");
  }
  for (Parameter<?> param : contents) {
    String txt = param.title.toString();
    if (param.required) {
      txt += "*";
    }
    JLabel label = new JLabel(txt);
    page.add(label);
    ParamField field = ParamField.create(param);
    JComponent component = field.doLayout();
    page.add(component, "span, wrap");
    fields.put(param, field);
    if (param.description != null) {
      JLabel info = new JLabel("<html>" + param.description.toString());
      page.add(info, "skip, span, wrap");
    }
  }
  return page;
}

相关文章