Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Please tell me how to run a JFrame in eclipse as when i put it in the Main class it runs but when i select some other frame in that same project that main class don't run....please tell me the buttons to run that main class every time when i run it

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    5
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please tell me how to run a JFrame in eclipse as when i put it in the Main class it runs but when i select some other frame in that same project that main class don't run....please tell me the buttons to run that main class every time when i run it

    Please tell me how to run a JFrame in eclipse,as when i put it in the Main class it runs but when i select some other frame in that same project that main class don't run....please tell me the buttons to run that specific main class every time when i run my project


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: Please tell me how to run a JFrame in eclipse as when i put it in the Main class it runs but when i select some other frame in that same project that main class don't run....please tell me the buttons to run that main class every time when i run

    You don't run "JFrames" in Eclipse or in Java. Instead you compile and run Java programs, and these can display JFrames if they are coded correctly. So based on this, the correct way to display a JFrame is to write code that does this. Have you gone through the Java Swing tutorials to learn how to create and display JFrames and other top-level windows?

  3. #3
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    983
    Thanks
    7
    Thanked 207 Times in 183 Posts

    Default Re: Please tell me how to run a JFrame in eclipse as when i put it in the Main class it runs but when i select some other frame in that same project that main class don't run....please tell me the buttons to run that main class every time when i run

    In Eclipse select the "Run->Run configurations..." menu option. This will let you select the project and say which class will be regarded as the "Main class" for that project. Note that the class you make the Main class has to have a main() method!

Similar Threads

  1. need to make basic class and implementation class (base class without void main)
    By javanewbie101 in forum Object Oriented Programming
    Replies: 1
    Last Post: September 19th, 2012, 09:03 PM
  2. create a test class (main method) to start(run) the class in Java
    By curious725 in forum Java Theory & Questions
    Replies: 5
    Last Post: August 1st, 2012, 04:21 AM
  3. Main method/ class problem. I can't run any script!
    By BokBok in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 28th, 2012, 06:14 PM
  4. Not sure if run() or main(String[] args)
    By Brock Lee in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 25th, 2012, 01:19 PM
  5. Replies: 6
    Last Post: July 21st, 2011, 08:45 AM

Tags for this Thread