CrazyEngineers Forum - Computer Science & IT Engineering |
| Posted: 11 Dec 2010 10:45 PM PST Plz give me information about firewall(Working & types of firewall). |
| Doubt in java programming....? Posted: 08 Dec 2010 06:17 PM PST check this codes guy's... Quote: import java.io.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; /*<Applet code="p" height=400 width=400></applet>*/ public class p extends JApplet implements ActionListener { JLabel l1,l2; JButton b; JTextField f1,f2; String str; public void init() { l1=new JLabel("username"); l2=new JLabel("password"); b=new JButton("submit"); f1=new JTextField(20); f2=new JTextField(20); FlowLayout f=new FlowLayout(100,20,25); Container c=getContentPane(); c.setLayout(f); b.addActionListener(this); c.add(l1); c.add(f1); c.add(l2); c.add(f2); c.add(b); } public void actionPerformed(ActionEvent e) { Object o=e.getSource(); if(o==b) { repaint(); str=f1.getText()+" "+f2.getText(); RandomAccessFile r=null; try { //String dir="mohit"; r=new RandomAccessFile("mo.txt","rw"); r.writeBytes(str); r.close(); } catch(Exception ee) { } //r.close(); } } public void paint(Graphics g) { g.drawString(str,100,200); } } Can any one help me to find the mistakes. |
| You are subscribed to email updates from CrazyEngineers Forum - Computer Science & IT Engineering To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |
No comments:
Post a Comment