1 23 24 29 package org.dbforms.devgui; 30 31 import javax.swing.*; 32 33 34 35 41 public abstract class PropertyPanel extends javax.swing.JPanel 42 implements PropertyNames { 43 44 protected ProjectData projectData; 45 46 51 public PropertyPanel(ProjectData projectData) { 52 this.projectData = projectData; 53 54 } 56 57 62 public abstract void setNewProjectData(ProjectData projectData); 63 64 65 71 protected void addAFocusListener(final JTextField tf, 72 final String p) { 73 tf.addFocusListener(new java.awt.event.FocusAdapter () { 74 public void focusLost(java.awt.event.FocusEvent e) { 75 projectData.setProperty(p, tf.getText()); 76 } 77 }); 78 } 79 80 81 86 protected void showExceptionDialog(Exception e) { 87 JOptionPane.showMessageDialog(this, 88 "An exception occurred:\n\n" + e.toString() 89 + "\n", "Exception", 90 JOptionPane.ERROR_MESSAGE); 91 } 92 } 93 | Popular Tags |