Advertisement
NotATowel

Untitled

Sep 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. /**
  2. Name: Brandon Altuchow
  3. ID: 0207256
  4. Date: 9/23/17
  5. Description: Assignment 15 - GUI Applications
  6.  */
  7. package gui.applications;
  8. import javax.swing.*;
  9. import java.awt.*;
  10.  
  11. public class GUIApplications extends JFrame{
  12.     Container content = this.getContentPane();
  13.     Font nameFont = new Font("serif", Font.BOLD, 36);
  14.     Font dateFont = new Font("sansserif", Font.BOLD, 36);
  15.     Color nameColor = new Color(255,0,0);
  16.     Color dateColor = new Color(.1F,1.0F,.1F);
  17.     JLabel lblFName = new JLabel("Brandon");
  18.     JLabel lblLName = new JLabel("Altuchow");
  19.     JLabel lblDate = new JLabel("9/23/17");
  20.  
  21.     public GUIApplications(){
  22.         this.setVisible(true);
  23.         this.setSize(300, 300);
  24.         this.setTitle("First GUI App");
  25.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  26.        
  27.         content.setLayout(new GridLayout(3,1));
  28.         content.add(lblFName);
  29.         lblFName.setFont(nameFont);
  30.         lblFName.setForeground(nameColor);
  31.         content.add(lblLName);
  32.         lblLName.setFont(nameFont);
  33.         lblLName.setForeground(nameColor);
  34.         content.add(lblDate);
  35.         lblDate.setFont(dateFont);
  36.         lblDate.setForeground(dateColor);
  37.     }
  38.     public static void main(String[] args) {
  39.         GUIApplications gui = new GUIApplications();
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement