I am not a great programmer but I need to make a simple rule management system, the problem I am having is that due to the number of options I had to divide it up over two separate JFrames, what I have done so far is that when the' Next' button is clicked it will combine the users input into a single String which works fine but I need to access this String from the new class on the second JFrame at this point it seems what ever I try I end up with a null-point exception.
This is the code for my button (not including any of my poor attempts to pass it over!):
private void cmdnextActionPerformed(java.awt.event.ActionEvent evt) { ruleHeader = (String)lsbaction.getSelectedItem() + " " + (String)lsbprotocol.getSelectedItem(); if (cbsourceipany.isSelected()){ ruleHeader = ruleHeader + " any"; }else{ ruleHeader = ruleHeader + " " + txtsource.getText() + (String)lsbsourcex.getSelectedItem(); } if (cbsourceportany.isSelected()){ ruleHeader = ruleHeader + " any"; }else{ ruleHeader = ruleHeader + " " + txtsport.getText(); } if (cbdirect.isSelected()) { ruleHeader = ruleHeader + " <> "; }else{ ruleHeader = ruleHeader + " -> "; } if (cbdestipany.isSelected()){ ruleHeader = ruleHeader + " any"; }else{ ruleHeader = ruleHeader + " " + txtdest.getText() + (String)lsbdestx.getSelectedItem(); } if (cbdestportany.isSelected()){ ruleHeader = ruleHeader + " any"; }else{ ruleHeader = ruleHeader + " " + txtdestport.getText(); } txttest1.setText(ruleHeader); new Rule_Addition_Options().setVisible(true); }