You are on page 1of 2

1. WAP to display label on a frame with the help of jframe.

import javax.swing.JFrame;

import javax.swing.JLabel;

public class SwingBasic {

public void start() {

JFrame f=new JFrame("Type the name of frame");

JLabel l=new JLabel("Kunal(A51405215012)");

f.add(l);

f.setSize(400,400);

f.setVisible(true);

public static void main(String args[]) {

new SwingBasic().start();

}
Output

You might also like