File: DlgTest.java

package info (click to toggle)
king 2.24%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 78,588 kB
  • sloc: java: 111,577; xml: 1,868; cpp: 209; perl: 127; sh: 102; python: 99; makefile: 60; ansic: 7
file content (32 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// (jEdit options) :folding=explicit:collapseFolds=1:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class DlgTest //extends ... implements ...
{
    public static void main(String[] args) { new DlgTest(args).Main(); }

    public DlgTest(String[] args)
    {
    }

    public void Main()
    {
        JFrame frame = new JFrame("The Frame");
        frame.getContentPane().add(new JLabel("the frame"));
        frame.pack();
        frame.setVisible(true);

        // The following bug occurs in Java 1.4.0 and 1.4.0_01
        // but not in Java 1.3.1_01
        // Tested under RedHat Linux 7.3 and KDE

        JDialog dialog = new JDialog(frame, "The Dialog", true);
        //dialog.getContentPane().add(new JLabel("the dialog")); // this works great, no delay
        dialog.getContentPane().add(new JLabel("Hello World!")); // this waits several seconds before painting
        //dialog.getContentPane().add(new JProgressBar());       // this also waits several seconds before painting
        dialog.pack();
        dialog.setVisible(true);
    }
}//class