Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

GUI

Thread view: 
Glodalec - 26 Feb 2004 09:51 GMT
Hi !

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
only using Applets.
Thomas Weidenfeller - 26 Feb 2004 11:44 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
> only using Applets.

See the this groups FAQ, the Resources section with the pointers to the
Swing tutorial.

/Thomas
Glodalec - 27 Feb 2004 07:42 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 - 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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.