Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem With RSA Interface  RSS feed

 
Floetic Angel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Program complies and the interface shows up but there is no output after pressing run button. How come this is happening?

Thanks.

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The actionPerformed method is never called, because it is not registered as an ActionListener; you need to have something like "nc5.setActionListener(nc5)" in your run method.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your NewClass5 doesnt implement ActionListener.
NewClass5 extends JFrame implements ActionListener

Also you havent registered the RunButton as the action source
RunButton.addActionListener(this);

This gives a null pointer exception, but then, at least its working! (You havent initialized the plainText array.)
 
Floetic Angel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for your suggestions. There is still no output coming to the output window of the interface.

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After removing the "@Override" line that prevents compilation, the code compiles and runs fine. After clicking the run button something happens (it doesn't look like the correct thing, but at least output is displayed, so the button triggers an action).
 
Floetic Angel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I understand what you mean Im getting this on the general output of JCreator:

Plaintext:
Plaintext:
Plaintext:
Plaintext:
Plaintext:
Plaintext:
Plaintext:

Depending on how many times Ive clicked the Run button (which isnt correct, you are right about this) but for instance how would I manage to get that to show on the actual output window of the interface?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Carla Pinate:
.. how would I manage to get that to show on the actual output window of the interface?


The JTextArea as methods for this.
Use InputStringTextField.setText(String text) or InputStringTextField.append(String text) as per your requirement.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!