Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Beginning Java
code error
Brad Cantrell
Greenhorn
Posts: 22
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Im getting this error message
C:\Java>javac converter.java converter.java:9: 'class' or 'interface' expected private static void createAndShowGUI() {
with this code
import java.awt.*; public class converter { JPanel mainPane; } private static void createAndShowGUI() { initLookAndFeel(); //Window Theme JFrame.setDefaultLookAndFeelDecorated(false); //Window Creation JFrame frame = new JFrame("Converter"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E); //Window Content Converter converter = new Converter(); converter.mainPage.setOpaque(true); frame.setContentPane(converter.mainPage); //Window Display frame.pack(); frame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
Matti Poro
Ranch Hand
Posts: 41
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The methods should be inside the class.
public class converter { JPanel mainPane; } //End of class
Brad Cantrell
Greenhorn
Posts: 22
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thx
Let's get him boys! We'll make him read this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
threads for GUI and command-line
Help with ActionListener
How does inner class access outter class functions?
why use static method in creating gui
fixed element in gridbaglayout
More...