0% found this document useful (0 votes)
4 views1 page

JLabel JFrame

Uploaded by

sivarwshyar1982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

JLabel JFrame

Uploaded by

sivarwshyar1982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import javax.swing.

*;
import javax.swing.JLabel;
import javax.swing.border.Border;
import javax.swing.BorderFactory;
import java.awt.*;

public class GUI {


public static void main(String[]args){
JLabel label=new JLabel();
label.setText("hello iam a new programmer !");
ImageIcon image=new ImageIcon("logo.jpg");
Border border=BorderFactory.createLineBorder(Color.green,15); //
bakarde bo chwar chewa !

label.setIcon(image);
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.TOP);
label.setHorizontalAlignment(JLabel.CENTER);
label.setVerticalAlignment(JLabel.TOP);
label.setFont(new Font("MV Boli",Font.BOLD,60));
label.setIconTextGap(10);
label.setForeground(Color.green);
label.setBackground(Color.black);
label.setOpaque(true);
label.setBorder(border);
//label.setBounds(200,150,600,600); ama boxoy labelaka abat jyay akatawa la framaka
!

JFrame frame=new JFrame();


// frame.setSize(900,800); labar away packman bakar henawa boya .
// frame.setLayout(null); lagal setbounds daya.
frame.setTitle("SIVAR");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(true);
frame.getContentPane().setBackground(Color.black);
frame.setIconImage(image.getImage());
frame.setVisible(true);
frame.add(label);
frame.pack();

}
}

You might also like