I'm getting the following error while I try to use this method in ActionListener DrawMap.java:71: error: cannot find symbol this.setVisible(false); ^ symbol: method setVisible(boolean) DrawMap.java:82: error: cannot find symbol this.setVisible(false); ^ symbol: method setVisible(boolean) Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 2 errors
class DrawMap extends JComponent{
private JLabel LabelTitle,MapNo;
private JTextField MapField;
private JButton Draw,Shape,Load,Back,Logout;
private JPanel Panel5;
private String UserName,Password,City;
public boolean check;
private int r,g,b;
private int flag =0;
public DrawMap(String UserName,String Password,String City){
Random p = new Random();
r = p.nextInt(255);
g = p.nextInt(255);
b = p.nextInt(255);
this.UserName = UserName;
this.Password = Password;
this.City = City;
/*Panel5 = new JPanel();
Panel5.setLayout(null);
this.add(Panel5);*/
JButton Draw = new JButton("Draw");
Draw.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
check=true;
repaint();
}
});
Draw.setBounds(550,60,100,50);
add(Draw);
JButton Shape = new JButton("Shape");
Shape.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
}
});
Shape.setBounds(650,60,100,50);
add(Shape);
JButton Load = new JButton("Load");
Load.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
}
});
Load.setBounds(250,500,100,50);
add(Load);
JButton Back = new JButton("Back");
Back.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
UserHome ush = new UserHome(UserName,Password,City);
ush.setVisible(true);
this.setVisible(false);
}
});
Back.setBounds(350,500,100,50);
add(Back);
JButton Logout = new JButton("Logout");
Logout.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Login L = new Login();
L.setVisible(true);
this.setVisible(false);
}
});
Logout.setBounds(450,500,100,50);
add(Logout);
}