History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-3790
Type: Usability Problem Usability Problem
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Jemerov
Reporter: Alexander Chernikov
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

GUI Designer: snapshots: non-String items in JComboBox, JList data model are not recognized

Created: 21 Sep 06 20:07   Updated: 26 Oct 06 15:33
Component/s: GUI Designer
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 5,734


 Description  « Hide
GUI Designer. Create a code with JComboBoxes accepting String and non-String items:
import java.awt.FlowLayout;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JFrame;

public class NonStringListCase {
	private static class Stringable {
		private String essence;
		Stringable() { this.essence = "null";  }
		Stringable(String s) { this.essence = s; }
		public String toString() { return essence; }
	}

	public static void main(String[] argv) {
		JList jlString = new JList(new String[]{"String 1", "String 2"});
		JList jcbObject = new JList(new Stringable[]{new Stringable(), new Stringable("another one")});
		JList jcbMix = new JList(new Object[]{"String 1", new Stringable("another one")});

		JPanel jp = new JPanel();
		jp.setLayout(new FlowLayout());
		jp.add(jlString);
		jp.add(jcbObject);
		jp.add(jcbMix);

		JFrame frame = new JFrame("Test");
		frame.setContentPane(jp);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}

Run. Take a snapshot. Result: jcbString's items are recognized and shown in form, but items of two other comboboxes are not. It's not the fact that user wants to get String items instead of original non-String. But we could snap their values to allow user work with them further and decide what to do.
The same effect with JList elements.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.