| Forum |
|
|||||||
| Programming The destination for developers - C, C++, Java, Python and the lot |
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|
#1 (permalink)
|
|
I am Optimus Prime
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
|
Can somebody suggest solution to the problem? Here is the code Code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
//<applet code=Login height=300 width=400></applet>
public class Login extends JApplet implements ActionListener
{
JTextField textCustName;
JPasswordField textPassword;
JLabel labelCustName, labelPassword;
JButton loginButton;
public void init()
{
createApplet();
}
public void createApplet()
{
JPanel panel;
panel = new JPanel();
getContentPane().add(panel);
panel.setLayout(new FlowLayout());
labelCustName = new JLabel("Customer login Name:");
textCustName = new JTextField(10);
labelPassword = new JLabel("Password:");
textPassword = new JPasswordField(10);
loginButton = new JButton("Login");
panel.add(labelCustName);
panel.add(textCustName);
panel.add(labelPassword);
panel.add(textPassword);
panel.add(loginButton);
loginButton.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
Object obj = evt.getSource();
if (obj == loginButton)
{
String entry = textCustName.getText() + ":" + new String(textPassword.getPassword());
try
{
RandomAccessFile logfile = new RandomAccessFile("Customer.txt","rw");
logfile.seek(logfile.length());
logfile.writeBytes(entry);
}
catch(IOException e)
{
showStatus("Cannot write on to the logfile"+e);
}
}
}
}
|
|
|
| Advertisements. Register and be a member of the community to get rid of them. | |
|
Advertisement
|
|
|
|
#2 (permalink) |
|
>:)I-):(|)8-X
Join Date: Sep 2004
Location: ಬೆಂಗಳೂರು (Bengaluru)
Posts: 3,512
|
What is the problem navjtoh? Though I dont know Java this looks very similar to C#. By looking at it , you may have some problem with event handler.
__________________
i5 2400 | DH67BL | G.Skill Ripjaw 4 GB | FSP SAGA II 500W | CM 430 Black Elite | MSI R6850 Cyclone PE/OC | XBox 360 Controller | 21.5" Samsung Sync Master 2233 | 4 Mbps UL |
|
|
|
|
#3 (permalink) |
|
I am Optimus Prime
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
|
Try running this code under JDK 1.6.0 and you will know what's the problem.
Hey no java programmer here? I want this answer fast. Last edited by navjotjsingh; 29-07-2007 at 08:22 PM. Reason: Automerged Doublepost |
|
|
|
|
#7 (permalink) |
|
>:)I-):(|)8-X
Join Date: Sep 2004
Location: ಬೆಂಗಳೂರು (Bengaluru)
Posts: 3,512
|
ROLF .. when I saw this thread bumped I thought navjoth still didnot fix the problem.
__________________
i5 2400 | DH67BL | G.Skill Ripjaw 4 GB | FSP SAGA II 500W | CM 430 Black Elite | MSI R6850 Cyclone PE/OC | XBox 360 Controller | 21.5" Samsung Sync Master 2233 | 4 Mbps UL |
|
|
|
|
#8 (permalink) | |
|
I am Optimus Prime
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
|
Quote:
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/programming/64100-java-programming-query.html
|
||||
| Posted By | For | Type | Date | |
| Thread java programming for 10 th std icse | Digit Forum | BoardReader | This thread | Refback | 06-07-2011 11:39 PM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| free online certificate in java programming | Ramakrishnan | Technology News | 11 | 03-11-2009 04:14 PM |
| Java programming..how can I distribute java program....? | Manojap | Programming | 5 | 16-05-2009 02:46 PM |
| Need help for my project using Java Programming | pritzdj | Programming | 6 | 28-04-2009 06:14 AM |
| Simple programming Error in Java | nitish_mythology | Programming | 2 | 15-10-2005 12:01 AM |
| JAVA PROGRAMMING | BLITZ~KRIEG! | Programming | 5 | 23-12-2004 02:21 PM |