Changeset 17569 for release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java
- Timestamp:
- 2008-10-22T15:15:53+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java
r15311 r17569 26 26 import javax.swing.JLabel; 27 27 import javax.swing.JCheckBox; 28 import javax.swing.ImageIcon; 29 import javax.swing.JButton; 30 import javax.swing.JOptionPane; 28 31 29 32 import org.tp23.antinstaller.input.InputField; … … 41 44 protected JCheckBox targetCheckBox = new JCheckBox(); 42 45 43 46 JPanel parent = null; 44 47 public TargetInputRenderer() { 45 48 } 46 49 public void initComponent(JPanel parent){ 50 this.parent = parent; 51 47 52 try { 48 53 jbInit(); … … 99 104 100 105 101 JLabel hlp = new JLabel("help"); 102 hlp.setToolTipText(outputField.getExplanatoryText()); 106 ImageIcon helpIcon = createImageIcon("/resources/help.png"); 107 JButton hlp = new JButton(org.tp23.antinstaller.Installer.langPack.getString("info"), helpIcon); 108 109 hlp.addActionListener( 110 new ActionListener() { 111 public void actionPerformed(ActionEvent e) { 112 JOptionPane.showMessageDialog(parent, outputField.getExplanatoryText(), outputField.getDisplayText(), JOptionPane.QUESTION_MESSAGE); 113 } 114 } 115 ); 116 117 //hlp.setToolTipText(); 118 119 JPanel spacer = new JPanel(); 120 spacer.setPreferredSize(new Dimension(50, 1)); 103 121 104 122 JPanel p; … … 108 126 p.add( sizeLabel ); 109 127 p.add( targetCheckBox ); 128 p.add( spacer ); 110 129 p.add( hlp ); 111 130 content.add(p); … … 121 140 public void renderError() { 122 141 } 142 143 /** Returns an ImageIcon, or null if the path was invalid. */ 144 protected static ImageIcon createImageIcon(String path) { 145 java.net.URL imgURL = org.tp23.antinstaller.Installer.class.getResource(path); 146 if (imgURL != null) { 147 return new ImageIcon(imgURL); 148 } else { 149 //System.err.println("Couldn't find file: " + path); 150 return null; 151 } 152 } 153 123 154 }
Note:
See TracChangeset
for help on using the changeset viewer.