[TriLUG] possibly OT: java question

Joseph Mack NA3T jmack at wm7d.net
Tue May 31 18:07:11 EDT 2011


I'm teaching myself java (again) and am pretty clueless.

I have two similar files; one produces a border 
around a frame and one doesn't (but I thought it would). 
Here is the minimum code that reproduces the problem.

code that doesn't produce a border

----
//DisplayClock.java
//
//to run
//
//javac DisplayClock.java
//java DisplayClock

import javax.swing.JFrame;

public class DisplayClock extends JFrame{

         public DisplayClock(){
         } //default constructor

         public static void main(String[] args) {

                 DisplayClock frame = new DisplayClock();
                 frame.setSize(300,200);
                 frame.setVisible(true);

         } //main()

} //DisplayClock

-------

If I change the string "Clock" to "Caock" (and change the 
filename), I get the expected border. Here's the results 
from some other strings.


Border     Noborder
Caock      Clock
            Plock

The code is from a book by Liang. When I download his code, 
I don't get the border either, but his other JFrame examples 
all produce borders.

I get the problem with jdk 1.5 and 1.6

Any idea what's going on?

Joe
-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list