简体   繁体   中英

How can we open new view at the same frame with split pane and button?

I have a JSplitPane in Java Swing. One part of the split pane has buttons to open a new view. I want to open a new view on the other part of the split pane.

How can it be done?

Your buttons need to have ActionListeners or Actions assigned. Inside these listeners create the new view and add it to the JSplitPane's other view.

If creating a new view takes too much time you need to perform the activities on a separate thread, releasing the Event Dispatching Thread that invoked your listener so the UI does not freeze.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM