B
Bill C
Hi, I cannot figure out
what is wrong with this simple code.
I get "illegal start of type" as an error and "identifier expected" as
a second error with the file called SimpleGui5.java
as:
import javax.swing.*;
import java.awt.*;
import java.awt.event.
public class SimpleGui5 {
public static void main (String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("click HERE");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
}
)
But I don't get an error with the file called TwoButtons.java as:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TwoButtons {
public static void main (String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("click HERE");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
}
}
WHY??? Am I blind?? Thank you!!!!
what is wrong with this simple code.
I get "illegal start of type" as an error and "identifier expected" as
a second error with the file called SimpleGui5.java
as:
import javax.swing.*;
import java.awt.*;
import java.awt.event.
public class SimpleGui5 {
public static void main (String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("click HERE");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
}
)
But I don't get an error with the file called TwoButtons.java as:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TwoButtons {
public static void main (String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("click HERE");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
}
}
WHY??? Am I blind?? Thank you!!!!