Search in sources :

Example 6 with Dialog

use of java.awt.Dialog in project jdk8u_jdk by JetBrains.

the class AlwaysOnTopFieldTest method main.

public static void main(String[] args) {
    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    Window window = new Frame("Window 1");
    window.setSize(200, 200);
    window.setAlwaysOnTop(true);
    window.setVisible(true);
    toolkit.realSync();
    Dialog dialog = new Dialog(window, "Owned dialog 1");
    dialog.setSize(200, 200);
    dialog.setLocation(100, 100);
    dialog.setVisible(true);
    toolkit.realSync();
    try {
        if (!window.isAlwaysOnTop()) {
            throw new RuntimeException("Window has wrong isAlwaysOnTop value");
        }
        if (!dialog.isAlwaysOnTop()) {
            throw new RuntimeException("Dialog has wrong isAlwaysOnTop value");
        }
    } finally {
        window.dispose();
        dialog.dispose();
    }
    window = new Frame("Window 2");
    window.setSize(200, 200);
    window.setVisible(true);
    toolkit.realSync();
    dialog = new Dialog(window, "Owned dialog 2");
    dialog.setSize(200, 200);
    dialog.setLocation(100, 100);
    dialog.setVisible(true);
    toolkit.realSync();
    window.setAlwaysOnTop(true);
    toolkit.realSync();
    try {
        if (!window.isAlwaysOnTop()) {
            throw new RuntimeException("Window has wrong isAlwaysOnTop value");
        }
        if (!dialog.isAlwaysOnTop()) {
            throw new RuntimeException("Dialog has wrong isAlwaysOnTop value");
        }
    } finally {
        window.dispose();
        dialog.dispose();
    }
}
Also used : Window(java.awt.Window) Frame(java.awt.Frame) Dialog(java.awt.Dialog) SunToolkit(sun.awt.SunToolkit)

Example 7 with Dialog

use of java.awt.Dialog in project jdk8u_jdk by JetBrains.

the class MultiResolutionSplashTest method getScaleFactor.

static float getScaleFactor() {
    final Dialog dialog = new Dialog((Window) null);
    dialog.setSize(100, 100);
    dialog.setModal(true);
    final float[] scaleFactors = new float[1];
    Panel panel = new Panel() {

        @Override
        public void paint(Graphics g) {
            float scaleFactor = 1;
            if (g instanceof SunGraphics2D) {
                scaleFactor = ((SunGraphics2D) g).surfaceData.getDefaultScale();
            }
            scaleFactors[0] = scaleFactor;
            dialog.setVisible(false);
        }
    };
    dialog.add(panel);
    dialog.setVisible(true);
    dialog.dispose();
    return scaleFactors[0];
}
Also used : Graphics(java.awt.Graphics) Panel(java.awt.Panel) Dialog(java.awt.Dialog) SunGraphics2D(sun.java2d.SunGraphics2D)

Example 8 with Dialog

use of java.awt.Dialog in project jdk8u_jdk by JetBrains.

the class DimensionEncapsulation method run.

@Override
public void run() {
    runTest(new Panel());
    runTest(new Button());
    runTest(new Checkbox());
    runTest(new Canvas());
    runTest(new Choice());
    runTest(new Label());
    runTest(new Scrollbar());
    runTest(new TextArea());
    runTest(new TextField());
    runTest(new Dialog(new JFrame()));
    runTest(new Frame());
    runTest(new Window(new JFrame()));
    runTest(new FileDialog(new JFrame()));
    runTest(new List());
    runTest(new ScrollPane());
    runTest(new JFrame());
    runTest(new JDialog(new JFrame()));
    runTest(new JWindow(new JFrame()));
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    //runTest(new JScrollBar()); --> don't test defines max and min in
    // terms of preferred
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) Choice(java.awt.Choice) JTextArea(javax.swing.JTextArea) TextArea(java.awt.TextArea) JTextArea(javax.swing.JTextArea) Label(java.awt.Label) JLabel(javax.swing.JLabel) JTableHeader(javax.swing.table.JTableHeader) JToggleButton(javax.swing.JToggleButton) JToggleButton(javax.swing.JToggleButton) Button(java.awt.Button) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) JFrame(javax.swing.JFrame) Checkbox(java.awt.Checkbox) JDialog(javax.swing.JDialog) FileDialog(java.awt.FileDialog) Dialog(java.awt.Dialog) JTextField(javax.swing.JTextField) TextField(java.awt.TextField) JFormattedTextField(javax.swing.JFormattedTextField) JSlider(javax.swing.JSlider) ArrayList(java.util.ArrayList) List(java.awt.List) Canvas(java.awt.Canvas) JWindow(javax.swing.JWindow) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) ScrollPane(java.awt.ScrollPane) JScrollPane(javax.swing.JScrollPane) JTable(javax.swing.JTable) JSpinner(javax.swing.JSpinner) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JDialog(javax.swing.JDialog) JFrame(javax.swing.JFrame) Frame(java.awt.Frame) JInternalFrame(javax.swing.JInternalFrame) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JTextPane(javax.swing.JTextPane) JMenuItem(javax.swing.JMenuItem) Component(java.awt.Component) Scrollbar(java.awt.Scrollbar) Window(java.awt.Window) JWindow(javax.swing.JWindow) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) Panel(java.awt.Panel) JEditorPane(javax.swing.JEditorPane) JRootPane(javax.swing.JRootPane) FileDialog(java.awt.FileDialog) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Example 9 with Dialog

use of java.awt.Dialog in project jgnash by ccavanaugh.

the class ExpandingAccountTablePanel method showAccountFilterDialog.

public void showAccountFilterDialog() {
    Dialog dlg = new AccountListFilterDialog(accountPane.model);
    dlg.setVisible(true);
}
Also used : Dialog(java.awt.Dialog)

Example 10 with Dialog

use of java.awt.Dialog in project jgnash by ccavanaugh.

the class MainRegisterPanel method showAccountFilterDialog.

public void showAccountFilterDialog() {
    Dialog dlg = new AccountListFilterDialog(registerTree);
    dlg.setVisible(true);
}
Also used : AccountListFilterDialog(jgnash.ui.account.AccountListFilterDialog) Dialog(java.awt.Dialog) AccountListFilterDialog(jgnash.ui.account.AccountListFilterDialog)

Aggregations

Dialog (java.awt.Dialog)37 Frame (java.awt.Frame)22 Window (java.awt.Window)8 Container (java.awt.Container)5 JButton (javax.swing.JButton)5 Graphics (java.awt.Graphics)4 Panel (java.awt.Panel)4 JInternalFrame (javax.swing.JInternalFrame)4 JPanel (javax.swing.JPanel)4 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)3 BorderLayout (java.awt.BorderLayout)3 Component (java.awt.Component)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 MouseEvent (java.awt.event.MouseEvent)3 JDialog (javax.swing.JDialog)3 DialogControls (org.gephi.datalab.spi.DialogControls)3 AttributeColumnsManipulatorUI (org.gephi.datalab.spi.columns.AttributeColumnsManipulatorUI)3 DialogDescriptor (org.openide.DialogDescriptor)3 Button (java.awt.Button)2