File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes help~! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help~! " Watch "help~! " New topic
Author

help~!

li qing
Greenhorn

Joined: Sep 27, 2003
Posts: 11
below is my source code for my JPanel... i got an error... can someone teach me where the problem lies?

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class Applet1 extends JApplet {
public static void main(String [] args) {
Applet1 Applet = new Applet1();
}
class stringPanel extends JPanel {
//create all label and variable
private JLabel topLabel = new JLabel("Picture Finding Game");
private JLabel bottomLabel = new JLabel("\nDo you recongize those picture?");
private int x,y;
public stringPanel() {
JPanel strPanel = new JPanel();
strPanel.setLayout(new BorderLayout,(5,10)); ----> error:
'(' or '[' expected at line 20
strPanel.add(topLabel, BorderLayout.NORTH);
strPanel.add(bottomLabel, BorderLayout.CENTER);
}
}
}


~~Q|ng~~
Scott Ding
Greenhorn

Joined: Nov 27, 2002
Posts: 13
strPanel.setLayout(new BorderLayout,(5,10)); ----> error:
try this.
--->
strPanel.setLayout(new BorderLayout(5,10));
li qing
Greenhorn

Joined: Sep 27, 2003
Posts: 11
oh... ok... thanks a lot... the error is gone...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help~!
 
Similar Threads
for loop
Help counting the number of comparisons in sorting a list.
Reg:Applet to servlet Communication
Removing panel borders
help~!!!