Dialog dlg = new Dialog("My Dialog"); dlg.setLayout(new BorderLayout()); dlg.add(BorderLayout.CENTER, new SpanLabel("This is the body of the dialog, I can add anything I want here...")); dlg.add(BorderLayout.SOUTH, new Button(new Command("OK"));
d.setLayout( new GridBagLayout() );
/** * Test la version de java. */ public FudaaCommandLineParser() { // Verif version JVM if (System.getProperty("java.version").compareTo("1.2") < 0) { System.err.println("JVM >= 1.2 needed"); final Dialog dlg = new Dialog(new Frame(), "Error", true); dlg.addWindowListener(new WindowAdapter() { public void windowClosing(final WindowEvent _e) { System.exit(-1); // B.M. 27/08/99 Supprim pour cause d'exception disgracieuse l'cran // ((Dialog)e.getSource()).dispose(); } }); dlg.setLayout(new BorderLayout()); dlg.add(new Label("JVM >= 1.2 needed"), BorderLayout.CENTER); final Button okBut = new Button("OK"); okBut.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { System.exit(-1); // B.M. 27/08/99 Supprim pour cause d'exception disgracieuse l'cran // ((Dialog)((Button)e.getSource()).getParent()).dispose(); } }); dlg.add(okBut, BorderLayout.SOUTH); dlg.pack(); dlg.show(); } }
mainFrame.setLayout(new GridLayout(3, 1)); mainFrame.addWindowListener(new WindowAdapter() { @Override
aboutDialog.setLayout(aboutLayout); aboutDialog.setVisible(false); aboutDialog.setTitle("About AirReceiver");
private void makeWindow() { dialog = new java.awt.Dialog(IJ.getInstance(), "Loading...", false); dialog.setUndecorated(true); bytes = new Label("Loaded: 0 bytes "); speed = new Label("Speed: 0 bytes/s "); time = new Label ("Elapsed time: 0 s "); dialog.setLayout(new GridLayout(3,1)); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowDeactivated(java.awt.event.WindowEvent we) { dialog.toFront(); } }); dialog.add(time); dialog.add(bytes); dialog.add(speed); java.awt.Dimension screen = dialog.getToolkit().getScreenSize(); dialog.pack(); dialog.setLocation(screen.width/2 - dialog.getWidth()/2, screen.height/2 - dialog.getHeight()/2); //dialog.setVisible(true); } Monitor(Connection con) {
dialog.setLayout(new BorderLayout()); dialog.add(new Label(message), BorderLayout.WEST); dialog.add(tfInput, BorderLayout.CENTER);
public static void showMessageDialog(Component parentComponent, String message, String title, int messageType) { final Dialog dialog = new Dialog(getFrame(parentComponent), title); dialog.setModal(true); dialog.setLayout(new BorderLayout()); dialog.add(new Label(message), BorderLayout.CENTER); Panel panel = new Panel(); Button btOk = new Button("OK"); panel.add(btOk); dialog.add(panel, BorderLayout.SOUTH); dialog.pack(); dialog.addWindowListener(windowListener); btOk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ev) { dialog.hide(); } }); dialog.show(); }
if (dialog==null) { dialog = new Dialog(imageJ, "Built-in Functions"); dialog.setLayout(new BorderLayout()); dialog.addWindowListener(this); Panel northPanel = new Panel();
if (dialog==null) { dialog = new Dialog(imageJ, "Built-in Functions"); dialog.setLayout(new BorderLayout()); dialog.addWindowListener(this); Panel northPanel = new Panel();
dialog.setLayout(new FlowLayout()); dialog.addWindowListener(this);
d.setLayout(new GridLayout(1, 1)); Button b=new Button("Ok"); TextArea msg=new TextArea(message);
buttonPanel.setLayout(new BoxLayout(buttonPanel, 0)); this._dialog.add(buttonPanel); this._dialog.setLayout(new BoxLayout(this._dialog, 1)); this._dialog.pack(); Point loc = parentWindow.getLocation();
dialog.setLayout(new FlowLayout()); dialog.addWindowListener(this);
dialog.setLayout(new FlowLayout()); dialog.addWindowListener(this);