package learningSwingByYoutube;
import java.awt.Color;
import java.awt.Font;
import java.awt.Label;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.Border;
public class Main02 {
public static void main(String[] args) {
ImageIcon image2 = new ImageIcon("image1.jpg");
Border border = BorderFactory.createLineBorder(Color.green);
JLabel label = new JLabel();
label.setText("Bro, do you even code?");
label.setIcon(image2);
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.TOP);
label.setForeground(new Color(200,100,100));
label.setFont(new Font("MV Boli", Font.PLAIN,50));
label.setIconTextGap(100);
label.setBackground(Color.black);
label.setOpaque(true);
label.setBorder(border);
label.setVerticalAlignment(JLabel.CENTER);
label.setHorizontalAlignment(JLabel.CENTER);
JFrame frame = new JFrame();
frame.setTitle("Jframe title goes here");
frame.setSize(420, 420);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.add(label);
frame.pack();
}
}