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();
}
}
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];
}
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");
}
}
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);
}
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);
}
Aggregations