Results 1 to 10 of 10
- 06-07-2011, 12:38 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Google Style Button - Has it been done before?
Hello,
I hope this question hasn't been answered yet, I'm kind of uncertain as to how to search for what I want.
Everyone using gmail has probably noticed those nice buttons that enable you to select/deselect all/some emails. Now my question is, is there a Swing component that behaves like that?
For those of you without a gmail account, here a short description of what this button should do:
After a click of the button a drop-down list opens and the user can make a selection. Other than in regular drop-down menus, there is no TextField where the selection is shown (just a plain button).
Admittedly, I could probably just create my own implementation of JComboBox to achieve something similar than that, but I'm kind of stuck on how to remove the TextField from this component.
Any Ideas? I'll be glad for any suggestions.
~Clemens
- 06-07-2011, 01:19 PM #2
I did not understand the unique property of the component you are trying to describe. But Google web services use GWT. Check GWT components. You might find your answer there. But i guess it is not possible to use GWT in a swing application. In that case you can try SWT :) In the worst case, you can implement it in Swing starting from the lowest level as you described...
- 06-07-2011, 01:34 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Sorry for my bad description, I just noticed that this behaviour is very similar to some buttons on this very forum - for example the 'Forum Actions' and 'Quick Links' Buttons at the top navigation bar. How would I do this in Java (without going from the bottom up if possible)?
- 06-07-2011, 01:40 PM #4
I didnt think it is a bad description...
In swing, if you cant obtain what you are looking for by customizing an existing component with its own methods, you should develop your own component or find one that is already developed somewhere else.
Check following page for third-party swing components:
Swing Depot: Component Suites
- 06-07-2011, 02:47 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
They're JMenus (or equivalent) aren't they?
Here's the tutorial.
- 06-07-2011, 05:10 PM #6
- 06-08-2011, 12:00 PM #7
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Thanks
Thanks that put me on the right track, I'm gonna take a look at Jidesoft's components.
Appreciate all the help,
cheers,
C
- 06-08-2011, 12:10 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
I still don't see why a bog standard JMenu doesn't work for you:
That will create a menu bar, with a menu in it that is identified solely by that graphic, with a text menu item.Java Code:private static JMenuBar createMenuBar() { JMenuBar bar = new JMenuBar(); JMenu menu = new JMenu(); bar.add(menu); menu.setIcon(new ImageIcon("arrow_down_blue.gif")); JMenuItem menuItem = new JMenuItem("Something"); menu.add(menuItem); return bar; }
- 06-08-2011, 02:21 PM #9
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Hi,
Admittedly that works just as the button I described, but the 'look and feel' would be different. Anyways, I decided to use NetBeans DropDownButton, which looks exactly like I expected.
~C.
- 10-13-2011, 03:42 AM #10
Member
- Join Date
- Oct 2011
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Change GUI Window Style in netbeans
By helptoall in forum NetBeansReplies: 1Last Post: 03-23-2011, 05:31 AM -
New to Swing, need some advice on programming style
By Gorgro in forum AWT / SwingReplies: 1Last Post: 10-31-2010, 07:41 PM -
Making a picture Warhol Style
By chick in forum New To JavaReplies: 4Last Post: 04-13-2010, 09:08 PM -
Long boolean coding style
By Aldius in forum New To JavaReplies: 10Last Post: 10-23-2009, 12:51 AM -
Cascading Style Sheets
By smart in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 12-27-2008, 05:25 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks