Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. public class A extends B{
  2.  
  3. public static void main(String[ ] args) {
  4. A();
  5. }
  6.  
  7. protected static void A(){
  8. //- Frame
  9. JFrame frame_loading = new JFrame("Loading");
  10. frame_loading.setSize(250, 100);
  11. frame_loading.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  12. frame_loading.setLayout(new BorderLayout());
  13. frame_loading.setLocationRelativeTo(null); // Center in screen
  14.  
  15. //- Text
  16. JLabel label_loading = new JLabel(" Loading... ");
  17. label_loading.setFont(new Font("Tahoma", 0, 15));
  18. frame_loading.add(label_loading, BorderLayout.WEST);
  19.  
  20. //- Text
  21. JLabel label_number = new JLabel();
  22. label_number.setFont(new Font("Tahoma", 0, 15));
  23. frame_loading.add(label_number, BorderLayout.CENTER);
  24.  
  25. frame_loading.setVisible(true);
  26.  
  27. for(...){
  28. label_number.setText(Integer.toString(i + 1));
  29. }
  30.  
  31. frame_loading.dispose();
  32. }
  33.  
  34. JPanel panel = new JPanel();
  35. panel.setLayout(new BorderLayout());
  36.  
  37. //- ContentPane
  38. Container pane = frame_loading.getContentPane();
  39. pane.setLayout(new BorderLayout());
  40.  
  41. frame_loading.add(panel);
  42. frame_loading.pack();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement