• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help~!

 
li qing
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
}
}
}
 
Scott Ding
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
strPanel.setLayout(new BorderLayout,(5,10)); ----> error:
try this.
--->
strPanel.setLayout(new BorderLayout(5,10));
 
li qing
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh... ok... thanks a lot... the error is gone...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic