[java] how do i make applet html links
im new and ive been looking on suns site,
but its hard to find examples on specific things what i am really looking for is some examples on useing the panel class.
or on classes in general if anyone knows of a good site for tutorials or examples id appreciate it.
What i want to be able to do is to look at the java api and know how to use what im looking at.i want to know what each partis and how to fit it together or what i need to do to make it work. what i can change and what cant be changed
for instance right now im trying to make a link in my applet to a webpage and thats all.
id appreaciate any links or examples any all can throw my way
thanks in advance.
to show how bad im lost ill put my last try up here for anyone to get a laugh at,
the guys in the sun forums seem to be too far advanced to reply to newbie questions like mine
//import java.awt.*;
//import java.applet.*;
// public class testap6 extends Applet implements MouseListener
// {
// public void Canvas() {
// thelinkbox.panel.addMouseListener(this); // is this right?
// }
// public void init() {
// addMouseListener(this);//should i put the link box in here
// }
// public boolean mouseClicked(MouseEvent Event)// event
// {
// getAppletContext().showDocument(www.pietrick.com ,mainpage);
// }
// public void paint (Graphics g)
// {
// g.setColor(Color.green); // when i click this painted area
// g.fillRect(10,10,50,50); // i want it to open a new webpage
// }
// public void mousePressed(MouseEvent event) {}
// public void mouseReleased(MouseEvent event) {}
// public void mouseEntered(MouseEvent event) {}
// public void mouseExited(MouseEvent event) {}
i get about 20 30 different errors for this
A couple easy points:
Take out that public void Canvas(). I don''t know what it''s for.
And the first argument of showDocument is an URL so you need to do new URL("www.pietrick.com") and the second argument is a string so put quotes around mainpage if it''s not a variable.
Also, MouseListener is in java.awt.event.
That should take care of a couple errors
Take out that public void Canvas(). I don''t know what it''s for.
And the first argument of showDocument is an URL so you need to do new URL("www.pietrick.com") and the second argument is a string so put quotes around mainpage if it''s not a variable.
Also, MouseListener is in java.awt.event.
That should take care of a couple errors
thanks i appreaciate any input i dont have alot of time to do work on this.
so its a hobby because i ussually only get a chance to sit down and do it once or twice a week.
i reallly wanna learn java and oop in general seems my bigest draw back is understanding to use the api i think if i could get the classes and oop down i could learn it alot faster
so its a hobby because i ussually only get a chance to sit down and do it once or twice a week.
i reallly wanna learn java and oop in general seems my bigest draw back is understanding to use the api i think if i could get the classes and oop down i could learn it alot faster
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement