import javax.swing.*; import java.awt.*; public class HelloJava { public static void main( String[] args ) { JFrame frame = new JFrame( "Hello, Java!" ); frame.setSize( 300, 300 ); frame.setVisible( true ); class HelloComponent extends JComponent { public void paintComponent( Graphics g ) { g.drawString( "Hello, Java!", 125, 95 ); HelloComponent hello = new HelloComponent(); frame.add( "hello" ); } } } }
I'm following this E-book i got from the android market (O'Reilly), and so far i got a lot of minor errors, and the book doesn't show how to fix it, so i was hoping you could help me out. (also, this is my first serious attempt to learn programming).
I'm using Eclipse