Share « JFrame « Java Swing Q&A





1. Java GUI: Sharing values across different JFrames    stackoverflow.com

I'm writing some experimental GUI code. I'm trying to set it up so calling main generates two windows, each with a button and a label. The label displays how many times ...

2. Sharing Data Members between two JFrames    java-forums.org

I have two classes that extend JFrame, call them frame1 and frame2. Frame1 is basically the main window while frame2 is an "options" window. Frame1 has a data member called "mystring". It also has a button called "optionsButton" which loads the options window. In the options window I have yet another button that is called "resetStringButton". When I click on this ...

3. Sharing Variables Among Multi-JFrame Environment?    java-forums.org

Hi Guys, I'm pretty new to Java and have been racking my brains these past few days trying to work out how to achieve this. I'm am creating an application that stores information about users, to open the application you are first presented with a login screen (username and password). Upon correct entry of user and pass, you are taken to ...

4. Sharing data between two JFrames    java-forums.org

I have a program that is working that currently reads data from a .txt file, then saves to an arraylist which then that data is shown in a JListBox and also JTextFields. The user clicks a button to add new data entry and it currently uses JOptionPane to collect data. I want to change this. I have created a second form ...

5. How to share info between two JFrames    forums.oracle.com

There's no magic here. You pass information from one JFrame to another just as you would any other class. The simplest is via getter's and setters, but you can do tricks such as using Observable patterns (like Swing does) to loosen coupling. The key here usually is either having one JFrame hold a reference to the other JFrame, or perhaps some ...