use of com.sun.java.swing.plaf.windows.WindowsLookAndFeel in project jdk8u_jdk by JetBrains.
the class bug6524424 method main.
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
return;
}
TestPanel panel = new TestPanel();
JFrame frame = new JFrame();
frame.setContentPane(panel);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
use of com.sun.java.swing.plaf.windows.WindowsLookAndFeel in project jdk8u_jdk by JetBrains.
the class bug8046391 method main.
public static void main(String[] args) throws Exception {
OSType type = OSInfo.getOSType();
if (type != OSType.WINDOWS) {
System.out.println("This test is for Windows only... skipping!");
return;
}
SwingUtilities.invokeAndWait(() -> {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
System.out.println("Creating JFileChooser...");
JFileChooser fileChooser = new JFileChooser();
System.out.println("Test passed: chooser = " + fileChooser);
});
// Test fails if creating JFileChooser hangs
}
use of com.sun.java.swing.plaf.windows.WindowsLookAndFeel in project jdk8u_jdk by JetBrains.
the class bug8004298 method main.
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
robot.setAutoDelay(50);
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (javax.swing.UnsupportedLookAndFeelException ulafe) {
System.out.println(ulafe.getMessage());
System.out.println("The test is considered PASSED");
return;
}
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
});
toolkit.realSync();
Point point = Util.invokeOnEDT(new Callable<Point>() {
@Override
public Point call() throws Exception {
Rectangle rect = tree.getRowBounds(2);
Point p = new Point(rect.x + rect.width / 2, rect.y + rect.height / 2);
SwingUtilities.convertPointToScreen(p, tree);
return p;
}
});
robot.mouseMove(point.x, point.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
toolkit.realSync();
}
Aggregations