I'am creating simple application with GUI and I'am having pannels as individual classes that are included in MainFrame. I am asking here for the right approach, how should panels that are in separated classes communicate like in example: i have button in panel1 and textarea in panel2, i want to click on a button to append some string in textarea but those are individual components(classes). Button1 doesnt have textarea in his scope. I know i can set getter for button and add listener in class i need it but I want here right approach so any help is appreciated!
Communication between JPannel components
73 Views Asked by user2740217 At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in USER-INTERFACE
- Perl Command Line Interpreter crashing on exit
- Android - How to check for button click in a custom alert dialog box?
- Working towards a more advanced graphics game
- Use GUI displayed results of SQL query vs new queries?
- Efficiently design method to construct a Java GUI?
- Implementing callback function for dialog-based application
- Ui-router URL changes, nested view not loading
- Dont see anything inside my jframe
- Sliding Card Design
- Display value of Y axis inside GUI plot
- Sash becomes lost after resize
- Java Swing Drawing Rectangles
- How do I convert point to local coordinates?
- WPF Workaround to add Window control as a child of visual
- Developing multi page app like Viber interface using Qt Quick?
Related Questions in COMMUNICATION
- Trouble interfacing/communicating between Arduino Block and Intel Edison
- Sharing thread between processes
- Making socket communication using bin_prot
- Communication between WinCE device and Windows PC over USB
- JSF Scopes and Beans
- Android Fragments fundamentals: why? Is this conceptually wrong?
- crash when using outputstream android studio
- Synchronizing a current message id in a conversation between Alice and Bob
- Google App Engine inter module communication authorization (python)
- Object communication vs String using RabbitMQ and Mule
- netty: how to get complete message from client
- Influence of fast position change when using WLAN or e.g. 2.4GHz
- Delphi Memory Mapped Files Notice new data?
- Want to connect java Client application with server i'm using jdbc
- Fail to get data struct from serial port
Related Questions in JCOMPONENT
- Efficiency of mouse listener on JButton
- Calling paintComponent method from another paintComponent method
- Drawing multiple graphic2d components into JPanel
- Can an Object type be casted to a Component type?
- Custom component doesn't show up
- Why do Java swing components show as NOT lightweight even though they should be?
- The method paint(Graphics g) of JComponent does not see the field
- How to create new and dispose jcomponents multiple times?
- How to twinkle the background color of any JComponent?
- More JPanel and background image
- Add Multiple transparent JComponents objects to just one JPanel
- Communication between JPannel components
- Adding 2 shapes at the same time on a jFrame
- JFrame instance doesn't visualise added component
- Count number of Children in JPanel
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Swing basically revolves around the MVC pattern. In your case the views would be the components and the controller might be a combination of listeners and an actual controller class that knows all the views. The model depends on your application and specific needs.
If a button just needs to update a single textarea a listener probably would be sufficient. Just pass a reference to the textarea that should be updated to the listener.
Here's an oracle tutorial on MVC: http://www.oracle.com/technetwork/articles/javase/index-142890.html