The Artima Developer Community
Sponsored Link

Java Answers Forum
why my repaint() didn't call paint() function

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Yoon-Ling

Posts: 8
Nickname: fan
Registered: Apr, 2002

why my repaint() didn't call paint() function Posted: Apr 23, 2002 11:20 PM
Reply to this message Reply
Advertisement
public class exelForm extends Applet{

private exelForm_GUI gui=new exelForm_GUI(this);


public void init(){
gui.init();
}

public void Submit(){
gui.Submit();
}
public void Reset(){
gui.Reset();
}


}

class exelForm_GUI {
public void Submit(){


if((loginField.getText()).equals("jojofang")&& (passwordField.getText()).equals("fang2044"))
{

applet.getAppletContext().showDocument(url);
}
else
{
badPass=true;
applet.repaint();
//loginField.setText("");
//passwordField.setText("");


}


}
public void paint(Graphics g){
if (badPass) {
g.setColor(Color.red);
g.setFont(e);
g.drawString("Incorrect Login ID or Password",100,170);
loginField.setText("this id ");
passwordField.setText("");
badPass= false;

}
}

class SubmitButtonListener implements ActionListener
{
private exelForm applet;

public SubmitButtonListener(exelForm listening_applet)
{
applet=listening_applet;
}
public void actionPerformed (ActionEvent event)
{
applet.Submit();
}
}

Topic: Erros in Java Previous Topic   Next Topic Topic: ImageCopy

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use