Results 1 to 4 of 4

Thread: Showing

  1. #1
    bostonstate is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default Showing

    Hi,

    I'm just starting out in java and have run into a problem. I am using the Netbeans IDE, selected a new project > Java Application Then added a new file from Swing GUI Forms > JApplet Form, then popped a few items on the form a button and label just to test.

    The problem is i can't get the form to load in the main method of main.java when i compile

    In vb.net this would be:

    Java Code:
    Dim Form as new Form1
    
    Form.Show
    but i'm just learning java and can't figure the appropriate form show method out.

    Could someone tell the code to show this form when the prgram is compiled?

    Thanks

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    the form to load
    What is "the form"? Is it a java class like JFrame? or some extension of the Window class?
    Have you read the API doc for the class to see if any of its methods would show it or make it visible. (hint visible is the term used)

    Does your textbook have any example programs? Any of them with GUI will have the necessary code.

  3. #3
    bostonstate is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default

    it's just a JFrame, how do i make it visible from the mianmethod in the main class?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Create a new instance of it and call the method to make it visible.
    Do you have any sample code for a program using GUI?

Similar Threads

  1. Need Help showing text in JTextArea
    By GuyFawkes in forum AWT / Swing
    Replies: 3
    Last Post: 05-05-2008, 09:19 AM
  2. Showing how to add Actions for KeyStrokes
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 04-23-2008, 08:17 PM
  3. Assert - not showing any msg on console
    By ravian in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 03:20 PM
  4. Why isn't this showing?
    By JToolTip in forum Java Applets
    Replies: 2
    Last Post: 07-07-2007, 11:54 PM
  5. Showing Images with J2ME
    By luisarca in forum CLDC and MIDP
    Replies: 0
    Last Post: 06-18-2007, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •