private void refresh() { try { if (landlord.getPerson().getDateOfBirth() != null) { dob.setText(formatter.format(landlord.getPerson().getDateOfBirth())); } if (landlord.getPerson().getName() != null) { name.setText(landlord.getPerson().getName()); } leasePanel.setData(landlord.getLeases()); notePanel.setData(landlord.getNotes()); modPanel.setData(landlord.getModifiedBy()); leasePanel.refresh(); notePanel.refresh(); modPanel.refresh(); dob.setText(formatter.format(landlord.getPerson().getDateOfBirth())); name.setText(landlord.getPerson().getName()); } catch (RemoteException ex) { Logger.getLogger(LandlordDetails.class.getName()).log(Level.SEVERE, null, ex); } }
private void setupDetails() throws RemoteException { /////// SET UP APPLICATION DETAILS PANEL detailsPanel.setSize(1000, 250); int space = 15; Border spaceBorder = BorderFactory.createEmptyBorder(space, space, space, space); Border titleBorder = BorderFactory.createTitledBorder("Landlord Details"); detailsPanel.setBorder(BorderFactory.createCompoundBorder(spaceBorder, titleBorder)); detailsPanel.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); ////////// FIRST ROW ////////// gc.gridx = 0; gc.gridy = 0; gc.weightx = 1; gc.weighty = 1; gc.ipady = 30; JLabel appRef = new JLabel("Landlord Ref "); Font font = appRef.getFont(); Font boldFont = new Font(font.getName(), Font.BOLD, 17); Font plainFont = new Font(font.getName(), Font.PLAIN, 17); appRef.setFont(plainFont); gc.fill = GridBagConstraints.NONE; gc.anchor = GridBagConstraints.EAST; gc.insets = new Insets(0, 0, 0, 0); detailsPanel.add(appRef, gc); JLabel ref = new JLabel(String.valueOf(landlord.getLandlordRef())); ref.setFont(boldFont); gc.gridx++; gc.anchor = GridBagConstraints.WEST; gc.insets = new Insets(0, 0, 0, 5); detailsPanel.add(ref, gc); JLabel corrName = new JLabel("Name "); corrName.setFont(plainFont); gc.gridx++; gc.anchor = GridBagConstraints.EAST; gc.insets = new Insets(0, 0, 0, 0); detailsPanel.add(corrName, gc); name = new JLabel(landlord.getPerson().getName()); name.setFont(boldFont); gc.gridx++; gc.gridwidth = 3; gc.anchor = GridBagConstraints.WEST; gc.insets = new Insets(0, 0, 0, 5); detailsPanel.add(name, gc); gc.gridx++; gc.gridwidth = 1; gc.anchor = GridBagConstraints.EAST; gc.insets = new Insets(0, 0, 0, 0); detailsPanel.add(new JLabel(""), gc); gc.gridx++; gc.anchor = GridBagConstraints.WEST; gc.insets = new Insets(0, 0, 0, 5); detailsPanel.add(new JLabel(""), gc); JLabel pDOB = new JLabel("Date of Birth "); pDOB.setFont(plainFont); gc.gridx++; gc.anchor = GridBagConstraints.EAST; gc.insets = new Insets(0, 0, 0, 0); detailsPanel.add(pDOB, gc); dob = new JLabel(formatter.format(landlord.getPerson().getDateOfBirth())); dob.setFont(boldFont); gc.gridx++; gc.anchor = GridBagConstraints.WEST; gc.insets = new Insets(0, 0, 0, 5); detailsPanel.add(dob, gc); }