Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class A extends B{
- public static void main(String[ ] args) {
- A();
- }
- protected static void A(){
- //- Frame
- JFrame frame_loading = new JFrame("Loading");
- frame_loading.setSize(250, 100);
- frame_loading.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame_loading.setLayout(new BorderLayout());
- frame_loading.setLocationRelativeTo(null); // Center in screen
- //- Text
- JLabel label_loading = new JLabel(" Loading... ");
- label_loading.setFont(new Font("Tahoma", 0, 15));
- frame_loading.add(label_loading, BorderLayout.WEST);
- //- Text
- JLabel label_number = new JLabel();
- label_number.setFont(new Font("Tahoma", 0, 15));
- frame_loading.add(label_number, BorderLayout.CENTER);
- frame_loading.setVisible(true);
- for(...){
- label_number.setText(Integer.toString(i + 1));
- }
- frame_loading.dispose();
- }
- JPanel panel = new JPanel();
- panel.setLayout(new BorderLayout());
- //- ContentPane
- Container pane = frame_loading.getContentPane();
- pane.setLayout(new BorderLayout());
- frame_loading.add(panel);
- frame_loading.pack();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement