Mary
Posts: 7
Nickname: dj
Registered: Mar, 2002
|
|
removing panels...
|
Posted: Mar 23, 2002 3:00 AM
|
|
I have tried to remove panels using the remove method in the Action performed event. I have used the repaint() method, revalidate() method and frame.pack() method. Nothing seems to be working.
public void actionPerformed(ActionEvent evt) { if (evt.getSource()== hardwareBtn) { controlArea.remove(lampPanel, kettlePanel, ovenPanel, microwavePanel); content.repaint(); } }
also i was just wondering if you can verify both a username and password in the one if statement. We can username verification working but can't get the two working together
public void actionPerformed(ActionEvent e) { if (e.getSource()==loginBtn) { String s = nameTxt.getText(); String t = passwordTxt.getText(); if (s.equals ("tange") && t.equals("100045713")) { JOptionPane.showMessageDialog(null,"Welcome " +nameTxt.getText()); } }
|
|