Changeset 28722 in osm for applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
- Timestamp:
- 2012-09-21T19:52:00+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r28648 r28722 7 7 import java.awt.Rectangle; 8 8 import java.awt.event.ActionListener; 9 import java.io.File; 9 10 10 11 import javax.swing.*; 12 13 import org.openstreetmap.josm.Main; 14 15 import S57.S57dat; 11 16 12 17 public class PanelMain extends JPanel { … … 21 26 public void actionPerformed(java.awt.event.ActionEvent e) { 22 27 // item.saveSign(???); 28 } 29 }; 30 public JButton openButton = null; 31 final JFileChooser fc = new JFileChooser(); 32 private ActionListener alOpen = new ActionListener() { 33 public void actionPerformed(java.awt.event.ActionEvent e) { 34 if (e.getSource() == openButton) { 35 int returnVal = fc.showOpenDialog(Main.parent); 36 if (returnVal == JFileChooser.APPROVE_OPTION) { 37 new S57dat(fc.getSelectedFile()); 38 messageBar.setText("Opening file"); 39 } 40 } 23 41 } 24 42 }; … … 37 55 38 56 messageBar = new JTextField(); 39 messageBar.setBounds(new Rectangle( 10, 430, 350, 20));57 messageBar.setBounds(new Rectangle(40, 430, 320, 20)); 40 58 messageBar.setEditable(false); 41 59 messageBar.setBackground(Color.WHITE); 42 60 add(messageBar); 61 openButton = new JButton(new ImageIcon(getClass().getResource("/images/fileButton.png"))); 62 openButton.setBounds(new Rectangle(10, 430, 20, 20)); 63 add(openButton); 64 openButton.addActionListener(alOpen); 43 65 saveButton = new JButton(); 44 66 saveButton.setBounds(new Rectangle(370, 430, 100, 20));
Note:
See TracChangeset
for help on using the changeset viewer.