JComboBox like History-Back in MS InternetExplorer

Hi

I am implementing GUI (Swing, 1.4.1) for application, which will be used to browse documents (scans jpg etc. and pdf and other formats). In the specification I have a sentence, that there should be possibility to go back to any previously browsed document, which should look similar and work exactly like History-Back button in MS InternetExplorer (but without "Back" label - only image) which looks like combination of a JButton (with left or right arrow - back - forward) and JComboBox (without this part, where selected item is displayed)

Does anyone have any suggestions how to do this?

I was thinking about modification of ComboBoxUI, but I've never touch UI, so I have no idea how to start with this and don't spend weeks on that.

Do You have any examples of something like this, any suggestions, sources or whatever?

Thank You

Maciek

[888 byte] By [lipmac1a] at [2007-9-29 18:51:01]
# 1

You dont need to use a combo-box for the History feature.

All you need are two JButtons, a JPopupMenu & a JTextField as follows:

|--|-|--|

|JB1|JB2 | JTxtField |

|

The first JButton acts as the 'Back' button.

The second JButton will simulate as a drop-down combo.

When the second button is clicked, the popup menu will be displayed in the location.

As for the data structure to hold the data, the best would be a 'java.util.Stack' since all the History data is accumulated in a Last-In-First-Out manner.

So whenever a address is typed in the textField, it gets added to the stack.

When JB2 is clicked, the popup menu is displayed will all elements from the stack(in order).

Regards,

javaUI

javaUIa at 2007-7-15 18:59:07 > top of Java-index,Archived Forums,Swing...
# 2
Yes I know that, but I thought that there is better way, to do that. You know, to have it in one component.Maciek
lipmac1a at 2007-7-15 18:59:07 > top of Java-index,Archived Forums,Swing...
# 3
I searched the forum using the keyword "historty" and found a few discussions on this topic.
camickra at 2007-7-15 18:59:07 > top of Java-index,Archived Forums,Swing...