Results 1 to 3 of 3
- 05-21-2011, 12:57 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Could not find the main class: ShowBorderLayout. Program will exit.
Hello! I have started to learn about GUI Basics from my book and typed this into Eclipse as usual. But it doesn't work.
All the other examples from the book have worked so far but the frames, flowlayout,gridlayout,buttonlayout examples have not.
I do not know why. But I get some error when compiling & running.
Could not find the main class: ShowBorderLayout. Program will exit.
Java Code:import javax.swing.*; public class MyFrameWithComponents { public static void main(String[] args) { JFrame frame = new JFrame("MyFrameWithComponents"); //add a button into the frame JButton jbtOK = new JButton("OK"); frame.add(jbtOK); frame.setSize(400,300); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); //center the frame frame.setVisible(true); } }
-
The problem has nothing to do with the code above and all to do with your ShowBorderLayout class.
- 05-21-2011, 01:19 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Could not find the main class, program will exit.
By CourseLanguage in forum New To JavaReplies: 18Last Post: 05-03-2011, 10:14 PM -
Could not find the main class, program will exit
By grottesco in forum New To JavaReplies: 7Last Post: 11-03-2010, 06:51 AM -
Could not find the main class, program will exit.
By aryubi in forum New To JavaReplies: 39Last Post: 02-19-2010, 10:02 AM -
Could not find the main class. Program will exit.
By XSROSSITER in forum New To JavaReplies: 0Last Post: 01-30-2010, 04:17 AM -
Could not find the main class. Program will exit.
By Carrier in forum New To JavaReplies: 1Last Post: 04-22-2009, 02:27 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks