|
I was converting a Java Swing program from a web tutorial and ran into this error:
205 +++ actionLabel.setText(prefix||String(source.getPassword()) || "\"") +++ ^^^^^^^^^^^ +++ Error: The method 'getPassword()' cannot be found in class 'javax.swing.JTextField' or a superclass After some headscratching, I determined that it was a scope problem, since "source" was define/used as JTextField prior to this use as a JPasswordField: if (textFieldString.equals(e.getActionCommand())) then do source = JTextField e.getSource() actionLabel.setText(prefix || source.getText()"\"") end else if (passwordFieldString.equals(e.getActionCommand())) then do source = JPasswordField e.getSource() actionLabel.setText(prefix||String(source.getPassword()) || "\"") end To fix it, I used a different variable name for "source" for the JPassword use. I was wondering if there is any way the compiler can catch this as a scope error, so the resulting message can be less misleading as to the nature of the problem. |
|
Most compilers I've used do/provide this with a crossref/xref option. Is this not available in NetRexx? Peter On 23 Dec 2013 05:56, "Stephen Rondeau" <[hidden email]> wrote: _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
| Free forum by Nabble | Edit this page |
