Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Name: Brandon Altuchow
- ID: 0207256
- Date: 9/23/17
- Description: Journal 6C - Fonts & Colors
- */
- package journal6c;
- import javax.swing.*;
- import java.awt.*;
- public class Journal6C extends JFrame{
- Container content = this.getContentPane();
- JLabel lbl = new JLabel("Brandon");
- JLabel lbl2 = new JLabel("Altuchow");
- JLabel lbl3 = new JLabel("9/23/17");
- Font fnt = new Font("serif", Font.BOLD, 36);
- Font fnt2 = new Font("sansserif", Font.PLAIN, 36);
- Font fnt3 = new Font("monospaced", Font.ITALIC, 36);
- Color foreClr = new Color(1.0F, .49F, .25F);
- Color foreClr2 = new Color(255,255,255);
- public Journal6C(){
- content.setLayout(new FlowLayout());
- content.add(lbl);
- lbl.setFont(fnt);
- lbl.setForeground(foreClr);
- lbl.setBackground(Color.BLUE);
- lbl.setOpaque(true);
- content.add(lbl2);
- lbl2.setFont(fnt2);
- lbl2.setForeground(foreClr2);
- lbl2.setBackground(Color.BLACK);
- lbl2.setOpaque(true);
- content.add(lbl3);
- lbl3.setFont(fnt3);
- lbl3.setForeground(Color.YELLOW);
- lbl3.setBackground(Color.RED);
- lbl3.setOpaque(true);
- this.setVisible(true);
- this.setSize(300,400);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setTitle("Gui App");
- }
- public static void main(String[] args) {
- Journal6C gui = new Journal6C();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement