So i've created a frame as the parent class for a dialog. This dialog is non modal. What i want to do is freely display text on the dialog at any given time. Ive tried creating built in methods but im not sure how to call them.

heres a watered down version of what im trying to do

Code:

public class progView extends FrameView {

public progView(SingleFrameApplication app) {
super(app);

initComponents();

getFrame().setDefaultCloseOperation(3);

etc etc

showDebug(); //intialise the dialog with text area
[b] debugWindow.debugPanelAppendText("test"); //this line does not work - debugWindow is a local dialog variable[/b]

so essentially i want to know if its possible to use dialogs in this manner and if i'm approaching the problem correctly. it seems like it isnt looking at the class when im directly calling a method from it and rather its looking at the super class that it extends.

well anyway looking forward to some input

thanks

05-10-2011, 01:47 AM

Fubarable

You'll need a reference to the other class in order to change its behavior (here the text it displays). To do this, the one class that is changing the behavior to the second class will need an instance field to the second class (your dialog) and then call its public methods as needed. It could possibly create the instance from within it and then display it or it could get a reference to the dialog object via a constructor or method (setter method) parameter.

public ProgView(DebugWindow myDebugWindow) {
this.myDebugWindow = myDebugWindow;
// don't need to call methods to display the DebugWindow as
// it likely has been called by the method calling this constructor
}

wow thats all i needed to solve my problem, so simple!!!! sorry im more of a c++ coder but yeah all of the classes are capitalized its just in that example i was changing a few names to make it easier to read lol big thankyou again, not very familiar with java guis.