![]() |
| ||
| Passing control yay this first time that I develop something larger ;) My problem: main method display a frame with buttons where you choose what function/action you want to perform. Once you press a button I want the main window become invisible and windows with option for function to become visible. So what I did is public void actionPerformed(ActionEvent e)however this get me following error C:\MyApp.java:54: cannot find symbol with call doSomething() I want to triger this public RenameImage() I don't even what to google for :confused: |
| ||
| Re: Passing control hmm, the blatantly obvious: check whether the method actually exists in the same class you're calling it from. And of course rename RenameImage to renameImage. |
| ||
| Re: Passing control Came to same conclusion when I went to bed(funny enought I always find solution to problem went I go to sleep). But thats fine as long there would be solution :lol: Now this peace of code doesn't do exactly what I want to do if(e.getSource() == btnFirst)it hidde myApp for time which take to display second application window and then it will display it again. I'm missing sort of control mechanizm which check if second window still in use, if yes keep it hidden. I tried to use while loop and check boolean in second application, but that kicked my CPU activity to 100% and I have to force to shut-down. So how I do I get around this? Secondly, I use JFrame setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) to close my windows, but this kill both frames. So how do I specify I want to close only second JFrame? |
| ||
| Re: Passing control NEW UPDATE Problem with killing both JFrames sorted, replaced JFrame.EXIT_ON_CLOSE with JFrame.DISPOSE_ON_CLOSE. Now I add it WindowEvents so if windowDeactivated it will setVisible to false and windowActivated to setVisible to true. However I can't triger windowActivated when I close the second window. What shall I do? |
| ||
| Re: Passing control Finaly found solution to my problem :cheesy: Bellow is example code from java forum(link here) which shows how this thing can be done import java.awt.*; |
| All times are GMT -4. The time now is 3:31 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC