tom bom

tom bom

  • NA
  • 15
  • 1.3k

Java Swing notepad

Jan 5 2018 6:34 AM
I'm working with Intellij IDEA, Java 9.0.1 and Gradle.
 
I have a JSplit with a JList on the left and JTabbedPane on the right
 
 
After creating some "open" function to import a text file to the program, I want to see the imported file in the following manner:
  • The filename.extension on the JList (LEFT)
  • The textual content on the JTabbedPane (RIGHT)
What I've tried:
  • Created a JList & JTabbedPane, added them to a JSplit.
  • I have a JFileChooser action listener, when the user opens his file... this is where I'm stuck.
Final Questsion: how to properly add files using JFileChooser in a way they will be added both to JTabbedPane and to JList simultaneously & relatively?