I’m working on a college project to allow a user select a csv file via a file chooser in a GUI and then display a checkbox for each column of the file.
I have the back end code written to handle any number of columns but the problem I’m having is displaying the checkboxes. The way I approached this was to put the file chooser in one panel and the checkboxes in a second with the intention of adding the second panel, setting it visible, from a actionListener method, once the file had been read.
However without the array of checkbox names filled when the GUI is first setup I’m unable to display the checkboxes.
I’ve since tried using both tabbed layout tabbed layout and card layout and read up on wizard layout, but from what ive seen, these all had their components initalised and the action listeners were simply setting them visible/invisible?
At this stage Im beginning to wonder is it even possible to do this in a single gui or how could I approach the problem with two GUI’s.
I’ve only been using java for 3months and any pointers in the right direction would be a huge help,
Thanks!
Consider
revalidate()andrepaint()any container that is changed, or callingpack()on the JFrame if you need to resize it (not recommended if at all possible).