I am trying to make a frame similar to a JFileChooser. I have a scrollpane and 2 toggle buttons, one for list view, and other for icons view. I will be using CardLayout on the scrollpane. However, I don't know where to begin. I would like to know a good approach on this matter. How do I design the 2 panels that will be put over the scrollpane? Something similar is the GroupBox in C# forms.
Asked
Active
Viewed 226 times
0
-
Not quite, I need to know how to create custom views. For example, for the listView option, I will be able to create a Jlist(i think) that will be spread out horizontally on multiple columns. For iconsView i will have some thumbnails that will be displayed vretically on multiple rows, etc. – Pantaziu Cristian Mar 01 '12 at 12:14
-
My question was very confusing, i know, but you, sir, managed to show me exactly what I was looking for. Thank you. – Pantaziu Cristian Mar 01 '12 at 13:37
-
You're welcome. I deleted the earlier comments and combined them into an answer. – Andrew Thompson Mar 01 '12 at 13:52
2 Answers
2
If you want to create "something similar to JFileChooser" why not to take a look on code of JFileChooser
itself? You can find JDK source in file src.zip
under your JDK directory.

AlexR
- 114,158
- 16
- 130
- 208
1
See File Browser GUI for some tips.
I need to know how to create custom views. For example, for the listView option, I will be able to create a Jlist(i think) that will be spread out horizontally on multiple columns. For iconsView i will have some thumbnails that will be displayed vretically on multiple rows, etc.
For the detail view I'd tend to use a JTable
. 'horizontally in multiple columns' can be done using a list and setLayoutOrientation(int)
.

Community
- 1
- 1

Andrew Thompson
- 168,117
- 40
- 217
- 433
-
1+1 for `FileBrowser`! Simple `JTable` and `JList` examples maybe found [here](http://stackoverflow.com/q/7620579/230513). – trashgod Mar 02 '12 at 06:44
-