set the icon when the wizard page is loaded

cusax-fix
Yana Stamcheva 20 years ago
parent 252acc0d77
commit b8443a97c5

@ -94,7 +94,7 @@ public class Wizard extends WindowAdapter
private BufferedImage wizardIcon;
private JLabel wizardIconLabel = new JLabel();
private JLabel wizardIconLabel;
private JPanel wizardIconPanel
= new JPanel(new FlowLayout(FlowLayout.CENTER));
@ -503,8 +503,6 @@ private void initComponents() {
buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST);
wizardIconPanel.add(wizardIconLabel);
wizardDialog.getContentPane().add(
buttonPanel, java.awt.BorderLayout.SOUTH);
wizardDialog.getContentPane().add(
@ -542,14 +540,21 @@ public BufferedImage getWizzardIcon() {
}
public void setWizzardIcon(BufferedImage wizardIcon) {
wizardIconLabel = new JLabel();
wizardIconLabel.setBorder(BorderFactory
.createCompoundBorder(
BorderFactory.createEmptyBorder(20, 20, 20, 20),
BorderFactory.createTitledBorder("")));
this.wizardIconLabel.setIcon(new ImageIcon(wizardIcon));
this.wizardIconPanel.add(wizardIconLabel);
}
public void removeWizzardIcon() {
if(wizardIconLabel != null)
this.wizardIconPanel.remove(wizardIconLabel);
}
public void setReturnCode(int returnCode) {
this.returnCode = returnCode;
}

@ -195,6 +195,8 @@ public void pageShowing() {
this.wizardContainer.setNextFinishButtonEnabled(false);
this.wizardContainer.unregisterAll();
this.wizardContainer.removeWizzardIcon();
}
/**
@ -205,18 +207,6 @@ public void pageShowing() {
public void valueChanged(ListSelectionEvent e) {
if(!wizardContainer.isNextFinishButtonEnabled())
this.wizardContainer.setNextFinishButtonEnabled(true);
AccountRegistrationWizard wizard
= (AccountRegistrationWizard)tableModel
.getValueAt(accountRegsTable.getSelectedRow(), 0);
try {
this.wizardContainer.setWizzardIcon(
ImageIO.read(new ByteArrayInputStream(wizard.getIcon())));
}
catch (IOException e1) {
e1.printStackTrace();
}
}
/**
@ -254,6 +244,14 @@ public void pageNext() {
this.wizardContainer.getSummaryPage()
.setPreviousPageIdentifier(identifier);
try {
this.wizardContainer.setWizzardIcon(
ImageIO.read(new ByteArrayInputStream(wizard.getIcon())));
}
catch (IOException e1) {
e1.printStackTrace();
}
}
public void pageBack() {

Loading…
Cancel
Save