Results 1 to 3 of 3
  1. #1
    JavaChase is offline Member
    Join Date
    Mar 2014
    Posts
    3
    Rep Power
    0

    Exclamation Need help How Do I add to my frame

    I use Notepad++

    Here is My Java code I wrote

    Import java.swing.JFrame;

    class ShowAFrame {

    public static void main(String args[]) {
    JFrame myFrame = new JFrame();
    String myTitle = "Frame test";

    myFrame.setTitle(myTitle);
    myFrame.setSize(300, 200);
    myFrame.SetDefaultCloseOperation
    (JFrame.EXIT_ON_CLOSE);
    myFrame.SetVisble(true);
    }
    }

    Can some one edit the Code for me to add text with my frame i with it so I can understand how to Add text to my frame ?
    Last edited by JavaChase; 03-19-2014 at 11:58 PM. Reason: I need to know how to add frame

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default Re: Need help with Java code error

    Error: could not find or load main class ShowAFrame.class
    ShowAFrame.class is not the name of a class. It looks like the name of a file.
    Try the java command with just the class name:
    java ShowAFrame
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    JavaChase is offline Member
    Join Date
    Mar 2014
    Posts
    3
    Rep Power
    0

Similar Threads

  1. java code error
    By omitchel in forum New To Java
    Replies: 7
    Last Post: 02-27-2013, 12:15 PM
  2. Odd java code error
    By Craig9008 in forum New To Java
    Replies: 2
    Last Post: 02-01-2012, 05:55 PM
  3. Replies: 5
    Last Post: 06-05-2011, 03:19 AM
  4. Error using xml-rpc with java code
    By mith86 in forum New To Java
    Replies: 1
    Last Post: 01-04-2011, 03:48 PM
  5. Java code error!~ Please help
    By socboy6579 in forum New To Java
    Replies: 1
    Last Post: 10-15-2010, 04:47 AM

Tags for this Thread

Posting Permissions

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