Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. package layout_managers;
  2.  
  3. import java.awt.*;
  4. import javax.swing.*;
  5. import java.awt.event.*;
  6. import java.util.Calendar;
  7.  
  8. public class GUI_Clock extends JFrame {
  9.     JPanel timeDisplay;
  10.     JLabel hours, minutes, seconds, am_pm;
  11.  
  12.     public GUI_Clock() {
  13.         setLayout(new GridLayout(2, 1));
  14.         hours = new JLabel();
  15.         hours.setBackground(Color.RED);
  16.         hours.setVisible(true);
  17.         minutes = new JLabel();
  18.         minutes.setBackground(Color.BLUE);
  19.         minutes.setVisible(true);
  20.         seconds = new JLabel();
  21.         seconds.setBackground(Color.GREEN);
  22.         seconds.setVisible(true);
  23.         am_pm = new JLabel();
  24.         am_pm.setBackground(Color.WHITE);
  25.         am_pm.setVisible(true);
  26.        
  27.         timeDisplay = new JPanel(new GridLayout(1, 3));
  28.         timeDisplay.add(hours);
  29.         timeDisplay.add(minutes);
  30.         timeDisplay.add(seconds);
  31.         //timeDisplay.add(am_pm);
  32.         add(timeDisplay);
  33.         add(am_pm);
  34.        
  35.     }
  36.  
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top