|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (1 bit)
Join Date: Sep 2004
Posts: 1
|
Hello, I'm a newbie and I've spent far too long trying to work out why this parameter thing doesn't work for me.... It returns a null value, not very nice of it really.
my code: import java.awt.*; import java.applet.*; public class GridExample extends Applet { public Graphics g; Image pic1, pic2, pic3; String CardText; public void init() { pic1=getImage(getCodeBase(),"fishes.jpg"); pic2=getImage(getCodeBase(),"haben.jpg"); pic3=getImage(getCodeBase(),"avoir.jpg"); CardText=getParameter("word1"); } public GridExample() { this.setLayout(new GridLayout(5,9, 0, 0)); for (int counter=0; counter<45; counter++) { this.add(new Button(CardText + counter)); } } public Insets getInsets() { return new Insets(0, 0, 25, 0); } public void paint (Graphics gr) { g=gr; g.drawImage(pic1,0,0,this); } } my html (obvious html head and body tags left out 'cos the system wanted to go and execute the code!) (pointy bracket open) APPLET CODE="GridExample" WIDTH=1000 HEIGHT=540(pointy bracket close) (pointy bracket open)PARAM NAME="word1" VALUE="machen"(pointy bracket close) (pointy bracket open)/APPLET(pointy bracket close) It doesn't give me any error message in jconsole, but rather than have machen and the numbers on my cards I get "null" why? where have I gone wrong? And no it doesn't actually do anything yet, my code, I'm a newbie and just going at it one step at a time. Last edited by highab; 10-01-2004 at 03:58 PM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|