01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.tests;
15:
16: import org.pentaho.reportdesigner.crm.report.util.JFileChooserHelper;
17: import org.pentaho.reportdesigner.lib.client.components.CenterPanelDialog;
18:
19: import javax.swing.*;
20: import java.awt.*;
21:
22: /**
23: * User: Martin
24: * Date: 11.01.2007
25: * Time: 06:30:01
26: */
27: @SuppressWarnings({"ALL"})
28: public class JFilerChooserTest {
29: private static JFrame jFrame;
30:
31: public static void main(String[] args) throws Exception {
32: UIManager.setLookAndFeel(UIManager
33: .getSystemLookAndFeelClassName());
34:
35: for (int i = 0; i < 100; i++) {
36: Thread.sleep(300);
37: test();
38: }
39:
40: }
41:
42: private static void test() throws InterruptedException {
43: EventQueue.invokeLater(new Runnable() {
44: public void run() {
45: jFrame = new JFrame();
46: jFrame.setBounds(0, 0, 100, 100);
47: jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
48: jFrame.setVisible(true);
49: }
50: });
51:
52: new JFileChooserHelper(
53: CenterPanelDialog.ModalityType.DOCUMENT_MODAL);
54:
55: Thread.sleep(200);
56:
57: EventQueue.invokeLater(new Runnable() {
58: public void run() {
59: JFileChooser jFileChooser = new JFileChooserHelper(
60: CenterPanelDialog.ModalityType.DOCUMENT_MODAL);
61: System.out.println("OK");
62: jFrame.dispose();
63: }
64: });
65: }
66: }
|