/** Called when the panel becomes active. */ public void panelActivate() { parent.lockNextButton(); parent.lockPrevButton(); if (idata.installSuccess) { // We set the information centerPanel.add( new JLabel( parent.langpack.getString("FinishPanel.success"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(Box.createVerticalStrut(20)); if (idata.info.getWriteUninstaller()) { // We prepare a message for the uninstaller feature String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; centerPanel.add( new JLabel( parent.langpack.getString("FinishPanel.uninst.info"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING)); } // We add the autoButton centerPanel.add(Box.createVerticalStrut(20)); autoButton = ButtonFactory.createButton( parent.langpack.getString("FinishPanel.auto"), parent.icons.getImageIcon("edit"), idata.buttonsHColor); autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip")); autoButton.addActionListener(this); centerPanel.add(autoButton); } else centerPanel.add( new JLabel( parent.langpack.getString("FinishPanel.fail"), parent.icons.getImageIcon("information"), JLabel.TRAILING)); }
/** Builds the GUI. */ private void buildGUI() { // We initialize our layout JPanel contentPane = (JPanel) getContentPane(); layout = new GridBagLayout(); contentPane.setLayout(layout); gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(5, 5, 5, 5); // We prepare our action handler ActionsHandler handler = new ActionsHandler(); // Prepares the glass pane to block gui interaction when needed JPanel glassPane = (JPanel) getGlassPane(); glassPane.addMouseListener(new MouseAdapter() {}); glassPane.addMouseMotionListener(new MouseMotionAdapter() {}); glassPane.addKeyListener(new KeyAdapter() {}); // We set-up the buttons factory ButtonFactory.useButtonIcons(); ButtonFactory.useHighlightButtons(); // We put our components warningLabel = new JLabel( langpack.getString("uninstaller.warning"), icons.getImageIcon("warning"), JLabel.TRAILING); buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(warningLabel, gbConstraints); contentPane.add(warningLabel); targetDestroyCheckbox = new JCheckBox(langpack.getString("uninstaller.destroytarget") + installPath, false); buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 0.0); layout.addLayoutComponent(targetDestroyCheckbox, gbConstraints); contentPane.add(targetDestroyCheckbox); gbConstraints.fill = GridBagConstraints.HORIZONTAL; progressBar = new JProgressBar(); progressBar.setStringPainted(true); progressBar.setString(langpack.getString("InstallPanel.begin")); buildConstraints(gbConstraints, 0, 2, 2, 1, 1.0, 0.0); layout.addLayoutComponent(progressBar, gbConstraints); contentPane.add(progressBar); destroyButton = ButtonFactory.createButton( langpack.getString("uninstaller.uninstall"), icons.getImageIcon("delete"), buttonsHColor); destroyButton.addActionListener(handler); buildConstraints(gbConstraints, 0, 3, 1, 1, 0.5, 0.0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(destroyButton, gbConstraints); contentPane.add(destroyButton); quitButton = ButtonFactory.createButton( langpack.getString("installer.quit"), icons.getImageIcon("stop"), buttonsHColor); quitButton.addActionListener(handler); buildConstraints(gbConstraints, 1, 3, 1, 1, 0.5, 0.0); gbConstraints.anchor = GridBagConstraints.EAST; layout.addLayoutComponent(quitButton, gbConstraints); contentPane.add(quitButton); }