C:\Users\rob\Documents\SimpleGui1B.java:30: cannot find symbol
symbol : class Graphics
location: class MyDrawPanel
public void paintComponent(Graphics g)
^
C:\Users\rob\Documents\SimpleGui1B.java:32: cannot find symbol
symbol : variable Color
location: class MyDrawPanel
g.setColor(Color.orange);
^
2 errors
Tool completed with exit code 1
Paul Clapham wrote:No, that's not right. You don't get a Graphics to display. A Graphics object is an internal object which can be used by classes which need to display data, such as JPanel.
Looking at that code, I see you have declared a class which extends JPanel, but you haven't used any instances of that class anywhere. That means your GUI isn't going to contain any MyDrawPanel objects.
Dawid Skrzypczynski wrote:
Paul Clapham wrote:No, that's not right. You don't get a Graphics to display. A Graphics object is an internal object which can be used by classes which need to display data, such as JPanel.
Looking at that code, I see you have declared a class which extends JPanel, but you haven't used any instances of that class anywhere. That means your GUI isn't going to contain any MyDrawPanel objects.
Eclipse shows errors if you don't import these classes...
Paul Clapham wrote:No, that's not right. You don't get a Graphics to display. A Graphics object is an internal object which can be used by classes which need to display data, such as JPanel.
Looking at that code, I see you have declared a class which extends JPanel, but you haven't used any instances of that class anywhere. That means your GUI isn't going to contain any MyDrawPanel objects.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
luck, db
There are no new questions, but there may be new answers.
luck, db
There are no new questions, but there may be new answers.
luck, db
There are no new questions, but there may be new answers.
Don't get me started about those stupid light bulbs. |