> > Can someone show me the code (using Swing) for creating window with a
> > simple text within X-Windows terminal. I know how to interact graphicly
[quoted text clipped - 4 lines]
>
> /Thomas
I have seen them. None of them works. Perhaps I need something to
install to. I've read somewhere, I need to have Java Webstart installed.
I wrote a simple code which creates frame with title and waits to be
closed.
Here is an example:
import java.awt.*;
import java.awt.event.* ;
import javax.swing.* ;
public class FirstWindow
{
public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true) ;
JFrame frame = new JFrame("Title") ;
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
JLabel emptyLabel = new JLabel("Simple") ;
emptyLabel.setPreferredSize(new Dimension(200,100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER) ;
frame.pack();
frame.setVisible(true) ;
}
}
Adam - 27 Feb 2004 07:55 GMT
> > > Can someone show me the code (using Swing) for creating window with a
> > > simple text within X-Windows terminal. I know how to interact graphicly
[quoted text clipped - 30 lines]
> }
> }
Good for you. But what is the question?
Adam
Glodalec - 27 Feb 2004 08:27 GMT
> > > > Can someone show me the code (using Swing) for creating window
> with a
[quoted text clipped - 38 lines]
>
> Adam
I just found what was wrong. There was not . in a CLASSPATH, although I
don't understand if there is ONE class/file and you start it within the
same directory as where it is, why JAVA needs that ?
Andrew Thompson - 27 Feb 2004 15:46 GMT
> I just found what was wrong. There was not . in a CLASSPATH, although I
> don't understand if there is ONE class/file and you start it within the
> same directory as where it is, why JAVA needs that ?
Once compilers, interpreters etc. start
'assuming' things, errors happen that
are subtle and hard to debug.

Signature
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology