javax.swing.JDialog.setLayout()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(190)

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

JDialog.setLayout介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

GridBagConstraints constraints = new GridBagConstraints();
dialog.setLayout(gridbag);

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

this.setLayout(new GridLayout(0, 1));
this.add(new JLabel("Dialog close test.", JLabel.CENTER));
this.add(new JButton(new AbstractAction("Close") {

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

emailDialog.setLayout(new BorderLayout());

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

dialog.setAlwaysOnTop(true);
dialog.setModal(true);
dialog.setLayout(new GridLayout(2, 0, 10, 10));
JPanel pane = (JPanel) dialog.getContentPane();
pane.setBorder(new EmptyBorder(10, 10, 10, 10));

代码示例来源:origin: magefree/mage

d.setLayout(new BorderLayout());
d.add(g);
d.pack();

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

JDialog dialog = new JDialog();
dialog.setLayout( new GrigBagLayout() );

JPanel panel = new JPanel(...);
panel.add(...);
dialog.add(panel, new GridBagConstraints());

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

JDialog dlg = new JDialog(null, "My Dialog", false); // Create non-modal dialog.
dlg.setLayout(new BorderLayout());
dlg.add(myPanel, BorderLayout.CENTER);
dlg.pack();
dlg.setLocationRelativeTo(null);
dlg.setVisible(true);

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

private void initComponents(final JDialog dialog) {
    dialog.setLayout(new BorderLayout());
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.getContentPane().add(editorPanel, BorderLayout.CENTER);
    dialog.setPreferredSize(DEF_SIZE);
    dialog.setMinimumSize(MIN_SIZE);
    dialog.pack();
  }
});

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

Window containerWindow = SwingUtilities.getWindowAncestor(panel);
JDialog dialog = new JDialog(containerWindow);
dialog.setLayout(new BorderLayout());
dialog.setLocationRelativeTo(containerWindow);
dialog.setResizeable(false);
dialog.add(effectPanel, BorderLayout.CENTER);

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

import javax.swing.*;
import java.awt.*;
public class t {

  public static void main(String[] args) {
    JDialog downloadingDialog = new JDialog((JFrame)null ,"Start donwloading...");
    JProgressBar progressBar = new JProgressBar(JProgressBar.HORIZONTAL);
    progressBar.setIndeterminate(true);
    downloadingDialog.setLayout(new FlowLayout(FlowLayout.LEFT));
    downloadingDialog.add(progressBar);
    downloadingDialog.setSize(300, 100);
    downloadingDialog.setVisible(true);
  }
}

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

JDialog zMessageDialog = new JDialog((java.awt.Frame) null, true);
 zMessageDialog.setTitle("Order summary");
 zMessageDialog.setLayout(new BorderLayout());
 JTextArea zTextArea = new JTextArea("Blah blah\nblah blah\nblah blah");
 zTextArea.setEditable(false);
 zTextArea.setColumns(40);
 zTextArea.setRows(10);
 zTextArea.setBackground(null);
 JScrollPane zScrollPane = new JScrollPane(zTextArea);
 zMessageDialog.add(zScrollPane, BorderLayout.CENTER);
 zMessageDialog.revalidate();
 zMessageDialog.pack();
 zMessageDialog.setVisible(true);

代码示例来源:origin: lbalazscs/Pixelitor

private void addContent(JDialog d) {
  d.setLayout(new BorderLayout());
  if (addScrollBars) {
    JScrollPane scrollPane = new JScrollPane(content,
        VERTICAL_SCROLLBAR_AS_NEEDED,
        HORIZONTAL_SCROLLBAR_NEVER);
    d.add(scrollPane, BorderLayout.CENTER);
  } else {
    d.add(content, BorderLayout.CENTER);
  }
}

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

JDialog dialog = new JDialog();
dialog.setSize(300, 200);
dialog.setLayout(null);


JButton button = new JButton("Testbutton!");
button.setVisible(true);
button.setBounds(10,10,40,40);
dialog.add(button);

//Make dialog visible
dialog.setVisible(true);

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

JOptionPane jop = new JOptionPane();
JDialog dialog = jop.createDialog("File not found");
dialog.setLayout(new BorderLayout());
JLabel im = new JLabel("Java Technology Dive Log", new ImageIcon("images/gwhite.gif"), JLabel.CENTER);
dialog.add(im, BorderLayout.NORTH);
dialog.setVisible(true);

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

JDialog jd=new JDialog(loginpage.this,"User Registration");
jd.setModal(true);
jd.setLayout(null); // THIS IS A BAD IDEA //
jd.setLocationRelativeTo(null);
// This is somewhat pointless, you've set relative location, but know overridden it...
// You should also be relying on the layout manager and pack to determine the size...
jd.setBounds(400,300, 479, 329); 
jd.setResizable(false);
setLocationRelativeTo(loginpage.this);

// Add you other components

jd.setVisible(true);

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

for (File file : files) {
  try {
    ...
    HistogramPanel panel = new HistogramPanel(width, counts, height, horizon);
    JDialog dialog = new JDialog();
    dialog.setModal(false);        <---- very important
    dialog.setLayout(new BorderLayout());
    dialog.add(panel);
    dialog.pack();
    dialog.setLocationByPlatform(true);
    dialog.setVisible(true);
  } catch (...)
}

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

JDialog jDialog = new JDialog();
jDialog.setLayout(new GridBagLayout());
jDialog.add(new JLabel("Please wait..."));
jDialog.setMinimumSize(new Dimension(150, 50));
jDialog.setResizable(false);
jDialog.setModal(false);
jDialog.setUndecorated(true);
jDialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
jDialog.setLocationRelativeTo(null);
jDialog.setVisible(true);

代码示例来源:origin: lingfengsan/MillionHero

/**
 * @param f 设置OCR界面
 */
public BaiduNlpSettingDialog(JFrame f) {
  dialog = new JDialog(f, "输入", true);
  dialog.setBounds(20, 200, 400, 220);
  dialog.setLayout(null);
  dialogPane = dialog.getContentPane();
  addAppId();
  addApiKey();
  addSecretKey();
  addSetFinishButton();
  dialog.setVisible(true);
}

代码示例来源:origin: lingfengsan/MillionHero

/**
 *
 * @param f 设置OCR界面
 */
public BaiDuOcrSettingDialog(JFrame f){
  dialog = new JDialog(f, "输入",true);
  dialog.setBounds(20,200,400,220);
  dialog.setLayout(null);
  dialogPane = dialog.getContentPane();
  addAppId();
  addApiKey();
  addSecretKey();
  addSetFinishButton();
  dialog.setVisible(true);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

@Override
public void actionPerformed(ActionEvent e) {
  JDialog f = new JDialog(MedSavantFrame.getInstance(), "Pedigree Viewer", true);
  PedigreeCanvas pc = new PedigreeCanvas();
  pc.setFamilyName(patient.getFamilyID());
  pc.showPedigreeFor(patient.getID());
  f.setPreferredSize(new Dimension(650, 500));
  f.setLayout(new BorderLayout());
  f.add(pc, BorderLayout.CENTER);
  f.pack();
  f.setLocationRelativeTo(MedSavantFrame.getInstance());
  f.setVisible(true);
}

相关文章

JDialog类方法