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

82 views Asked by At

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?

1

There are 1 answers

3
queeg On

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.