
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This can help to your assignment in java
Typology: Lab Reports
1 / 1
This page cannot be seen from the preview
Don't miss anything!
import javax.swing.; import java.awt.; public class OOP_Exer { public static void main(String[] args) { FlowLayout fl = new FlowLayout(); //create the frame JFrame fr = new JFrame("OOP Exercise 2"); //set frame size fr.setSize(400,200); //create a text field JTextField txt1 = new JTextField("Place your password here...", 30); //create password field JPasswordField pwd = new JPasswordField(10); //add text field to the frame fr.setLayout(fl); fr.add(txt1); fr.add(pwd); //set frame visibility fr.setVisible(true); fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }