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

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

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

JDialog.setBounds介绍

暂无

代码示例

代码示例来源:origin: cmusphinx/sphinx4

public VUMeterMonitor() {
  vumeter = new VUMeter();
  vuMeterPanel = new VUMeterPanel();
  vuMeterPanel.setVu(vumeter);
  vuMeterPanel.start();
  vuMeterDialog = new JDialog();
  vuMeterDialog.setBounds(100, 100, 100, 400);
  vuMeterDialog.getContentPane().setLayout(new BorderLayout());
  vuMeterDialog.getContentPane().add(vuMeterPanel);
  vuMeterDialog.setVisible(true);
}

代码示例来源:origin: org.netbeans.api/org-openide-util

dialog.setBounds(findCenterBounds(parent.getGraphicsConfiguration(), dialog.getSize()));

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

public static void main(String... args) {
    JFrame f = new JFrame();

    f.setSize(600, 400);
    f.setVisible(true);

    MageFloatPane fp = new MageFloatPane();
    fp.setCard("Card");

    MageRoundPane popupContainer = new MageRoundPane();
    popupContainer.setLayout(null);

    popupContainer.add(fp);
    //popupContainer.setVisible(false);
    popupContainer.setBounds(0, 0, 320 + 80, 201 + 80);

    JDialog floatOnParent = new JDialog(f, false);
    floatOnParent.setUndecorated(true);
    floatOnParent.getContentPane().add(popupContainer);

    floatOnParent.setBounds(300, 100, 300, 200);
    floatOnParent.setVisible(true);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-util-ui

dialog.setBounds(findCenterBounds(parent.getGraphicsConfiguration(), dialog.getSize()));

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void setBounds(int x, int y, int width, int height) {
  super.setBounds(x, y, width, height);    //To change body of overridden methods use File | Settings | File Templates.
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void setBounds(Rectangle r) {
  System.out.println("setBounds r = " + r);
  super.setBounds(r);    //To change body of overridden methods use File | Settings | File Templates.
}

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

button.addActionListener( new ActionListener()
{
  public void actionPerformed(ActionEvent e)
  {
    JButton button = (JButton)e.getSource();
    Window window = SwingUtilities.windowForComponent(button);
    JDialog dialog = new JDialog();
    dialog.setBounds( window.getBounds() );
    dialog.setVisible(true);
  }
});

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

//Why is this working so well even without the ActionListener interface, and all I'm
//getting is minor format errors at the end brackets? Know how to fix it? 


final JButton newButton = new JButton("Send");
      newButton.setActionCommand("Send");
      textPane.add(newButton);
      newButton.setEnabled(true);
      newButton.addActionListener(new ActionListener();

         public void actionPerformed(ActionEvent e){

          // display/center the jdialog when the button is pressed
          JDialog digFree = new JDialog(digFree, "Hello", true);
          digFree.setLocationRelativeTo(newButton);
          digFree.setFocusable(true);
          digFree.setVisible(true);
          digFree.setBounds(20, 20, 100, 120);
         }

代码示例来源:origin: jaltekruse/OpenNotebook

public void setProblemDialogVisible(boolean b) {
  problemDialog.setBounds( (int) this.getLocationOnScreen().getX(),
      (int) this.getLocationOnScreen().getY(), 450,
      600);
  problemDialog.setVisible(b);
}

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

JFrame frame = new JFrame();
  frame.setBounds(0,0,400,200);
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);

// Special attention to this line, do not use same JFrame, create a dummy JFrame
// If you want to save memory you can also use new JDialog((JFrame)null)
  JDialog jd = new JDialog(new JFrame());
  jd.setModalityType(Dialog.ModalityType.MODELESS);
  jd.setBounds(0,0,100, 100);
  jd.setVisible(true);

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

public VUMeterMonitor() {
  vumeter = new VUMeter();
  vuMeterPanel = new VUMeterPanel();
  vuMeterPanel.setVu(vumeter);
  vuMeterPanel.start();
  vuMeterDialog = new JDialog();
  vuMeterDialog.setBounds(100, 100, 100, 400);
  vuMeterDialog.getContentPane().setLayout(new BorderLayout());
  vuMeterDialog.getContentPane().add(vuMeterPanel);
  vuMeterDialog.setVisible(true);
}

代码示例来源:origin: jaltekruse/OpenNotebook

public void setSampleDialogVisible(boolean b) {
  sampleDialog.setVisible(b);
  if (b) {
    sampleDialog.setBounds(this.getX() + 350, this.getY() + 200, 300,
        300);
  }
}

代码示例来源: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: org.gephi/welcome-screen

@Override
  public void run() {
    WelcomeTopComponent component = WelcomeTopComponent.getInstance();
    JDialog dialog = new JDialog(WindowManager.getDefault().getMainWindow(),
        component.getName(), false);
    dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    dialog.getContentPane().add(component);
    dialog.setBounds(212, 237, 679, 378);
    dialog.setVisible(true);
  }
});

代码示例来源:origin: org.gephi/welcome-screen

@Override
  public void run() {
    WelcomeTopComponent component = WelcomeTopComponent.getInstance();
    JDialog dialog = new JDialog(WindowManager.getDefault().getMainWindow(),
        component.getName(), false);
    dialog.getContentPane().add(component);
    dialog.setBounds(212, 237, 679, 378);
    dialog.setVisible(true);
  }
});

代码示例来源:origin: es.ucm.fdi.gaia/jCOLIBRI

public static void centerWindow(JDialog dialog)
  {
  Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
  dialog.setBounds((screenSize.width - dialog.getWidth()) / 2,
    (screenSize.height - dialog.getHeight()) / 2, 
    dialog.getWidth(),
    dialog.getHeight());
  }
}

代码示例来源: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: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

public void applyto(JDialog dialog) {
  if (location != null) {
    dialog.setLocation(location);
  } else {
    dialog.setBounds(Utilities.findCenterBounds(dialog.getSize()));
  }
  }
}

代码示例来源:origin: bcdev/beam

public void show() {
  if (dialog == null) {
    dialog = new JDialog(parentWindow, FilterSetsDialog.class.getSimpleName());
    FilterSetsForm filterSetsForm = new FilterSetsForm("wraw", this, new FilterSetFileStore(getFiltersDir()), new FilterWindow(dialog), filterSets);
    dialog.setContentPane(filterSetsForm);
    dialog.setBounds(new Rectangle(100,100,300, 300));
    //dialog.pack();
  }
  dialog.setVisible(true);
}

相关文章

JDialog类方法