Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Java Swing Gui intellji, Lab Reports of Java Programming

This can help to your assignment in java

Typology: Lab Reports

2020/2021

Uploaded on 04/01/2022

zurbito-jacque-landrito
zurbito-jacque-landrito 🇵🇭

5 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
import javax.swing.*;
import java.awt.*;
public class OOP_Exer2
{
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);
}
}

Partial preview of the text

Download Java Swing Gui intellji and more Lab Reports Java Programming in PDF only on Docsity!

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); } }