Main.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import javax.swing.*;
  2. import java.awt.*;
  3. //***************************************************************************
  4. // This class is responsible for running the Bar-code program.
  5. //
  6. // Author: Ali Badereddin
  7. // Date: September 09, 2005
  8. //
  9. //***************************************************************************
  10. public class Main
  11. {
  12. //---------------------------------------------------------------------
  13. // Run program...
  14. //---------------------------------------------------------------------
  15. public static void main (String[] args)
  16. {
  17. // Declare icon image
  18. Image titleBarIcon = Toolkit.getDefaultToolkit().getImage ("images/titleBarIcon.jpg");
  19. // Make sure we have nice window decorations.
  20. JFrame.setDefaultLookAndFeelDecorated(true);
  21. // Create and set up the window.
  22. JFrame frame = new JFrame("ASTI SPUMANTE BAR-CODE");
  23. frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
  24. // Set the icon for the frame
  25. frame.setIconImage (titleBarIcon);
  26. // Create and set up the content pane.
  27. JComponent newContentPane = new ASBarcode ();
  28. newContentPane.setOpaque(true); // content panes must be opaque
  29. frame.setContentPane(newContentPane);
  30. // Display the window.
  31. frame.pack();
  32. frame.setVisible (true);
  33. }
  34. }