Applet compiles but displays nothing
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Working through a book to refresh java skills and study for SCJP. I just compiled an applet and for whatever reason it will not display in applet viewer. Any ideas?
This is what I have in the HTML file:
This is really odd as this is basically how I've gotten every applet to work up to now....and yes this is straight out he book as its an example.
This is what I have in the HTML file:
This is really odd as this is basically how I've gotten every applet to work up to now....and yes this is straight out he book as its an example.
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Oh, my. Look extremely carefully at this line, in which you attempt to override the paintComponent method. Although this method is just one Component of a functioning applet, it's an important Component.
public void paintCompnent(Graphics window){
Subtle, eh?
[ July 27, 2005: Message edited by: Ernest Friedman-Hill ]
public void paintCompnent(Graphics window){
Subtle, eh?
[ July 27, 2005: Message edited by: Ernest Friedman-Hill ]
Matt Kidd
Ranch Hand
Posts: 267
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I've been having a lot of these since I'm using the command line and notepad. Is the reason I didn't get a compilation error is because I'm declaring a new method paintCompnent and the paintComponent from teh super class is whats actually being called?
posted 20 years ago
Yup.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Matt Kidd:
I've been having a lot of these since I'm using the command line and notepad. Is the reason I didn't get a compilation error is because I'm declaring a new method paintCompnent and the paintComponent from teh super class is whats actually being called?
Yup.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
There are a number of really marvelous free IDEs available, from simple ones like TextPad up through industrial-strength ones like Eclipse, NetBeans, and JDeveloper. Some of these would have indicated the mistake. Friends don't let friends program with NOTEPAD.EXE!
Matt Kidd
Ranch Hand
Posts: 267
posted 20 years ago
hmm....i read somewhere that its better to use notepad and the command-line so that I can internalize the inner workings so to speak of Java more. I understand that on the job I won't be using notepad but I'm worried that hte IDE will be a crutch for me at this stage of my relearning java. To whit, I've already downloaded and installed NetBeans at work (Not an IT job) and Eclipse at home.
I may repost this as its starting to get off topic...
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Ernest Friedman-Hill:
There are a number of really marvelous free IDEs available, from simple ones like TextPad up through industrial-strength ones like Eclipse, NetBeans, and JDeveloper. Some of these would have indicated the mistake. Friends don't let friends program with NOTEPAD.EXE!
hmm....i read somewhere that its better to use notepad and the command-line so that I can internalize the inner workings so to speak of Java more. I understand that on the job I won't be using notepad but I'm worried that hte IDE will be a crutch for me at this stage of my relearning java. To whit, I've already downloaded and installed NetBeans at work (Not an IT job) and Eclipse at home.
I may repost this as its starting to get off topic...
| We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








