-1

I'm working on creating a basic user interface and I wanted to try and create a portion that is in a scrollTaskPane and is capable of holding multiple entries. As I'm going about creating it I can obviously test it with a simple amount of entries but I'm confused how I can go about later allowing for it to take input to create entries in the scrollTaskPane of maybe 1 entry one time, and then later needing to allow for input of 20 entries. I only know how to use absolute positioning and am trying to figure out the best way to go about it. I also need to later be able to select each entry. For the entries that will eventually be called and displayed in my interface, I'm planning to store them in a simple text file and use a semicolon as a delimiter between the task "Type" "Name" "Description"(which will be accessible through a button) and "Due Date". Or I may try to learn to use a database for the information. But I haven't decided yet and don't know anything about connecting a database with a java program. enter image description here

This is the current look (the scrollTaskPane in the middle). And my goal is to put in entries that are each rectangle boxes going across the scrollTaskPane with a checkbox on the end of them. Should I use some sort of grid layout? Or something else? I'm a beginner at user interfaces, so any help is appreciated!

1 Answers1

1

You can make a custom layout, and then keep adding those layout. So extend a layout class, add TextField and a check box in the layout. Initialize the layout with your values, add then add to the ScrollTaskPane.

jjmontes
  • 24,679
  • 4
  • 39
  • 51
Zaid Qureshi
  • 1,203
  • 1
  • 10
  • 15
  • I had not thought of this idea! Thank you, I will try that. However, when I add the item to the scrollTaskPane will it know to place it below the previous entry or will it try to place it in the same place? How do I go about specifying placement? – Preston Rodeniser Mar 03 '16 at 19:20
  • add those layouts in a JList and the JList to the scroll pane or use a boxLayout may be look at [this example of layouts](https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html) or [JList with text boxes](http://www.devx.com/tips/Tip/5342) – Zaid Qureshi Mar 03 '16 at 19:28