Guest User

Untitled

a guest
Oct 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package fraction;
  2.  
  3. import java.awt.FlowLayout;
  4.  
  5. import javax.swing.*;
  6.  
  7. public class Results extends JFrame
  8. {
  9.     /**
  10.      * Added to remove warnings
  11.      */
  12.     private static final long serialVersionUID = 4966896968736638986L;
  13.  
  14.     public Results(String[] result)
  15.     {
  16.         setLayout(new FlowLayout(FlowLayout.CENTER,10, 20));
  17.         setTitle("Fractionator 2000");
  18.         setSize(300, 100);
  19.         setLocation(550, 300);
  20.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  21.         setResizable(false);
  22.        
  23.        
  24.         JLabel[] results = new JLabel[5];
  25.        
  26.         for(int i = 0; i < 5; i++)
  27.         {
  28.             results[i] = new JLabel(result[i]);
  29.         }
  30.        
  31.         for(int i = 0; i < 5; i++)
  32.         {
  33.             add(results[i]);
  34.         }
  35.        
  36.     }
  37.    
  38.  
  39.    
  40. }
Add Comment
Please, Sign In to add comment