Hi all friends, Iam new to swing I prepare one login dialog box using swing and i add one refresh button on that dialog box now i want to give one event on that refresh button so that when user click on refresh button that dialog box should refresh because if user type wrong username or password then they can refresh that dialog box and they can type again just like as html file's refresh button. below r my codes:- refresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //what should be the code here } }); Regards Bikash
Hi, Did u mean u want to refresh the TextFields in the dialog box? If so, assuming the text fields are userTF and passwordTF, in the actionPerformed() method put the following code: userTF.setText(""); passwordTF.setText("");
Hi, Thanks for ur reply now it working fine I want to send the userid and password to my servlet on the action event of my submit button for that i try to code like below but it is not sending userid and password to my servlet.Can any one plz guide me how i can do that.
uc = (HttpURLConnection)u.openConnection(); I hope uc above is an URLConnection object. if so change the code to: uc = u.openConnection(); //no need to type cast and remove the lines after this line including uc.setRequestProperty() these lines are needed in case of POST method, in your case, it is GET method.
Hi, I have tried as per ur given guide but couldn't slove my problem.My login dialog is not connecting with my servlet.Can u plz tell me where i have done mistake in my code.In my servlet iam getting parameter by :- String str = req.getParameter("name"); String str1 = req.getParameter("path"); I also tried like below in my loginDialog(swing)& servlet file but couldn't slove my problem:- String content =userid1+password1; printout.writeBytes(content); printout.flush(); printout.close(); Servlet file:- ============ DataInputStream dos =new DataInputStream(req.getInputStream ()); String str = dos.readLine(); out.println(str); Iam new to swing plz help me to slove my problem. Regards Bikash
Post by:autobot
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
a bit of art, as a gift, that will fit in a stocking