public GuiProgressUpdater() { window = new JDialog(MainWindow.instance, "Configuration fixer progress"); window.setLocationByPlatform(true); window.setLocation(60, 70); // window. box = Box.createVerticalBox(); window.add(box); currentActivity = new JLabel(String.format(htmlFormat, new Object[] {"Setting up..."})); progBar = new JProgressBar(); progBar.setString("Preparing to start..."); progBar.setFont(progBar.getFont().deriveFont(18F)); progBar.setStringPainted(true); progBar.setIndeterminate(true); progBar.setSize(370, 100); button = new JButton("Stop!"); button.addMouseListener(new QuitListener()); // b.setSize(40, 80); // window.getContentPane().setLayout(new FlowLayout()); // box.add(Box.createRigidArea(new Dimension((window.getSize().width / 2), 10))); box.add(Box.createRigidArea(new Dimension(0, 10))); // txt.setAlignmentY(CENTER_ALIGNMENT); box.add(currentActivity, TOP_ALIGNMENT + CENTER_ALIGNMENT); box.add(Box.createRigidArea(new Dimension(0, 10))); box.add(progBar, CENTER_ALIGNMENT); box.add(Box.createRigidArea(new Dimension(0, 10))); box.add(button, BOTTOM_ALIGNMENT + CENTER_ALIGNMENT); box.add(Box.createRigidArea(new Dimension(0, 10))); window.setSize(400, 120); // window.setBounds(900, 350, 400, 200); window.invalidate(); box.invalidate(); window.setVisible(true); }