Hi
So I aim to make a GUI with 9 buttons, each one opening up a new window (JDialog) with input fields/tickboxes etc...
My code so far opens up a new Jdialog but does not display my added components (JTextFields) I cannot see why. My JDialog is just blank.
Any ideas?
public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if (s == addHose) { // JDIalog JTextArea addOwner, addNumberOfSections, addBore, addUsage, addLength; JRadioButton addHasTapAttachment, addHasJet, addIsOnDisplay; // buttons JButton btnOK, btnCancel; // variables representing user input String owner, numberOfSections, bore, usage, length; AccessibleContext hasTapAttachment; AccessibleContext hasJet; AccessibleContext isOnDisplay; JPanel main, addHosePanel; JDialog addHoseD = new JDialog(); addHoseD.setLayout(new FlowLayout()); addOwner = new JTextArea(); addHoseD.add(addOwner); owner = addOwner.getText(); addNumberOfSections = new JTextArea(); addHoseD.add(addNumberOfSections); numberOfSections = addNumberOfSections.getText(); addBore = new JTextArea(); addHoseD.add(addBore); bore = addBore.getText(); addUsage = new JTextArea(); addHoseD.add(addUsage); usage = addUsage.getText(); addLength = new JTextArea(); addHoseD.add(addLength); length = addLength.getText(); addHoseD.setTitle("Add Hose"); addHoseD.setModal(true); addHoseD.setSize(250, 300); addHoseD.setVisible(true);