I’m looking to build out a Java GUI with a table area and an area that will display the data of a selected row of the table. I’ve never tried a multi-frame set up before so before I venture to do this I wanted to check with others. Is it difficult to have two frames and have them passing data back and forth? The idea would be that I could move the details frame anywhere I like on the screen or to a second monitor and allow the table to go full-screen if the user wants. Any input or examples are appreciated.
Share
You should have no problem in doing what you are after. You can have
publicmethods in each frame which expose properties and/or structures and you then pass the instance of oneJFrameto the other. This should allow you to pass data back and forth.That being said however, I think that this scenario is valid only when you have one, two, or at most three
JFrames. Having a lot of frames calling each other could result a maintenance nightmare.