mmmmmm .... no! Both main classes share data/instructions/etc between them. The event listener is listening on the serial com port,on event,parses this data stream,stores it to Derby database and up dates this back out to my jTable. This is a fully functional working app ..... dependent on BOTH main classes to funtion.
Well, you're not the first person to write applications and find they need to be changed due to new requirements. It sounds like you already have a communication channel from the serial port via the database to the GUI, so maybe you can piggyback on that to find out whatever it was. Or maybe you can build another communication channel.
..... all I need now is the proper code to bring this GUI back up from its iconified state ..... so the end user can again see the Gui. I don't know how to assemble a working code structure to do this.
or if you are calling it within a class that extends Frame
What you CAN'T do is call
This is the syntax for calling setState() IF setState() was a static method, which it is not.
You have to replace "Frame" with your own Frame reference variable.
If it still doesn't work post the 1-3 lines that are giving you grief.
...... if I put "setExtendedState(Frame.NORMAL);" under a test jButton in the MainDisplay class and manually maximized the screen, pressing this test button brings the Frame back to NORMAL just fine. I just can't get " setExtendedState(Frame.NORMAL);" to work outside of my GUI class (MainDisplay).
Somewhere in your code you are creating a new instance of MainDisplay like this
Or
The second one gives you a reference variable called "mainDisplay" (or whatever). Use this to invoke setState(), as in
I notice you keep referring to setExtendedState(), how is that different than setState(). I know setState() works but I don't know anything about setExtendedState().
I'm not sure anymore how to convey this to you. You ALREADY have a MainDisplay reference. Don't create yet another MainDisplay because it won't have any effect on your original instance.
Not counting these incorrect lines
show me the code where you are calling
Come to think of it, I don't see how this compiled
If MainDisplay is a class then you would have needed
What is the context of this snippit? Is it inside a method that is inside your MainDisplay class? Let's see the whole MainDisplay class, or at least the whole method.
"What is the context of this snippit? Is it inside a method that is inside your MainDisplay class? Let's see the whole MainDisplay class, or at least the whole method."
The two main class in this app are "MainDisplay" and "TwoWaySerialComm" Both have a "main class" ..... to run this app, you run "MainDisplay" .... that calls "TwoWaySerialComm" to run as well. Both are fully posted on here.
I have a listener already on the serial com port waiting for a string of data.
on event, I parse and save to derby database then query that data back to my GUI. I also turn on labels on the GUI and post that a 911 call was made and from what phone extension it came from.
The only problem I have is that if this apps window is iconified down in the tool bar at that time (911 call detected) , I can't see the warning message it is showing. I am simply looking for the code that will deiconify my apps window! so, I already have a list of things that are carried out "on event" .... just need to add a way to "show my hidden apps gui"
Here is my attempt at a small runnable piece of code that demonstrates your issue. That being: how to deiconify from another class instance, e.g. External.
Thanks! ..... I've run sample code like this before with no problem. Here the code is making "its own" Frame and acting on it.
The problem I'm having is that the way Netbeans builder creates my GUI, I cant see what code is needed to take the iconified window back to a visible display.
Can you show me a simple example of a Netbeans builder created GUI Frame with an external class calling the GUI back up from the toolbar? (lets say a simple timer firing (external class) a command to de-iconify the GUI)in the GUI's "MainDisplay" class
.... this may be what I need , but error says "state is "private" .... I will need to make that "public" and/or "static" I would think. (found in the JDK1.8) I don't know how to change this in Netbeans GUI builder. Is it possible to make this change in the Java JDK files itself?
.... after 3 days of trying to do this and getting nowhere, I gave up for now. I just now added a listener to the "911"label on the GUI that gets turned on in this event, then on label event, I call "setExtendedState(NORMAL);"
works perfect!! .... all of 3 mins to do : (