This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Linking and organizing combo boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Linking and organizing combo boxes" Watch "Linking and organizing combo boxes" New topic
Author

Linking and organizing combo boxes

Riemke Aggio
Greenhorn

Joined: Apr 30, 2012
Posts: 1

JComboBox dayComboBox = new JComboBox();
dayComboBox.setModel(new DefaultComboBoxModel
(new String[] {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31\t"}));
dayComboBox.setBounds(460, 75, 46, 20);
frame.getContentPane().add(dayComboBox);


JComboBox monthComboBox = new JComboBox();
monthComboBox.setModel(new DefaultComboBoxModel
(new String[] {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}));
monthComboBox.setBounds(516, 75, 46, 20);
frame.getContentPane().add(monthComboBox);

JComboBox yearComboBox = new JComboBox();
yearComboBox.setModel(new DefaultComboBoxModel
(new String[] {"2011", "2012", "2013", "2014"}));
yearComboBox.setBounds(572, 75, 56, 20);
frame.getContentPane().add(yearComboBox);


I have 3 combo boxes (above) for a user to select a date for the information they enter. How can I link them and temporarily store the data and then select the most recent date and the most recent 5 dates?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 5048
    
  10

Hello Riemke, and welcome to the Ranch!

So you've created the view (I do hope you created the view and didn't use some visual designer to autogenerate unreadable code).

I would think the next step would be to design and create the classes for modeling that data.


luck, db
There are no new questions, but there may be new answers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 5048
    
  10

Riemke. please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/59066-gui-fuel-calculator.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Linking and organizing combo boxes
 
It's not a secret anymore!