Example usage for javax.swing JDialog setName

List of usage examples for javax.swing JDialog setName

Introduction

In this page you can find the example usage for javax.swing JDialog setName.

Prototype

public void setName(String name) 

Source Link

Document

Sets the name of the component to the specified string.

Usage

From source file:MainClass.java

public static void main(String[] args) {
    JDialog d1 = new JDialog((JFrame) null, "Dialog 1");
    d1.setName("Dialog 1");

    JDialog d2 = new JDialog((Window) null, "Dialog 2");
    d2.setName("Dialog 2");

    Frame f = new Frame();
    f.setName("Frame 1");

    Window w1 = new Window(f);
    w1.setName("Window 1");

    Window w2 = new Window(null);
    w2.setName("Window 2");

    Window[] windows = Window.getWindows();
    for (Window window : windows)
        System.out.println(window.getName() + ": " + window.getClass());

}

From source file:MainClass.java

public static void main(String[] args) {
    JDialog d1 = new JDialog((JFrame) null, "Dialog 1");
    d1.setName("Dialog 1");

    JDialog d2 = new JDialog((Window) null, "Dialog 2");
    d2.setName("Dialog 2");

    Frame f = new Frame();
    f.setName("Frame 1");

    Window w1 = new Window(f);
    w1.setName("Window 1");

    Window w2 = new Window(null);
    w2.setName("Window 2");

    Window[] ownerlessWindows = Window.getOwnerlessWindows();
    for (Window window : ownerlessWindows)
        System.out.println(window.getName() + ": " + window.getClass());

}

From source file:MainClass.java

public static void main(String[] args) {
    JDialog d1 = new JDialog((JFrame) null, "Dialog 1");
    d1.setName("Dialog 1");

    JDialog d2 = new JDialog((Window) null, "Dialog 2");
    d2.setName("Dialog 2");

    Frame f = new Frame();
    f.setName("Frame 1");

    Window w1 = new Window(f);
    w1.setName("Window 1");

    Window w2 = new Window(null);
    w2.setName("Window 2");

    System.out.println("FRAME WINDOWS");
    Frame[] frames = Frame.getFrames();
    for (Frame frame : frames)
        System.out.println(frame.getName() + ": " + frame.getClass());

}

From source file:es.emergya.ui.base.Message.java

private void inicializar(final String texto) {
    log.trace("inicializar(" + texto + ")");
    final Message message_ = this;

    SwingUtilities.invokeLater(new Runnable() {

        @Override/*from  ww w  .j  av  a  2 s  . c o  m*/
        public void run() {
            log.trace("Sacamos un nuevo mensaje: " + texto);
            JDialog frame = new JDialog(window.getFrame(), true);
            frame.setUndecorated(true);
            frame.getContentPane().setBackground(Color.WHITE);
            frame.setLocation(150, window.getHeight() - 140);
            frame.setSize(new Dimension(window.getWidth() - 160, 130));
            frame.setName("Incoming Message");
            frame.setBackground(Color.WHITE);
            frame.getRootPane().setBorder(new MatteBorder(4, 4, 4, 4, color));

            frame.setLayout(new BorderLayout());
            if (font != null)
                frame.setFont(font);

            JLabel icon = new JLabel(new ImageIcon(this.getClass().getResource("/images/button-ok.png")));
            icon.setToolTipText("Cerrar");

            icon.removeMouseListener(null);
            icon.addMouseListener(new Cerrar(frame, message_));

            JLabel text = new JLabel(texto);
            text.setBackground(Color.WHITE);
            text.setForeground(Color.BLACK);
            frame.add(text, BorderLayout.WEST);
            frame.add(icon, BorderLayout.EAST);

            frame.setVisible(true);
        }
    });
}

From source file:com.aw.swing.mvp.JDialogView.java

private void createJDlg() {
    JDialog dlg;
    if (vsr instanceof JDialog) {
        dlg = (JDialog) vsr;// w  w w.  j  a  va 2  s .  c  o  m
    } else {
        //jcv2.0.1
        if (pst.isEmbeddedView()) {
            parentContainer = vsr;
        } else {
            dlg = assembleDialog();
            dlg.setName(getDlgName(vsr.getClass().getName()));
            parentContainer = dlg;
        }
    }
}