• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I make a GUI like this?

 
Jenkin Zheng
Greenhorn
Posts: 12
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,everyone.I am new here.How can I make a gui like this.
I have make a Demo like this..But when I click on the keyboard image,the Gui didn't exit . Now, I know CellRenderer only can display the UI.My English is poor, .Thanks,everyone.
 
Campbell Ritchie
Marshal
Posts: 52531
119
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

How much do you already know about GUIs? Have you seen the Java™ Tutorials, eg this section, or this section?
 
Jenkin Zheng
Greenhorn
Posts: 12
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

How much do you already know about GUIs? Have you seen the Java™ Tutorials, eg this section, or this section?
Thanks,very Much.
 
Jenkin Zheng
Greenhorn
Posts: 12
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read the JComboBox section. But I still didn't know how to add a ActionListener to the Keyboard image.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want the "Keyboard Image" part of the cell to behave different than the rest?
 
Jenkin Zheng
Greenhorn
Posts: 12
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hauke Ingmar Schmidt wrote:Do you want the "Keyboard Image" part of the cell to behave different than the rest?

Yes, Like this when I click the "closed image",the id infirmation will be deleted.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not easily done with the standard JComboBox which uses a JList and a ListCellRenderer as popup (the part that becomes visible after clicking the down arrow). You need a combobox that creates a custom popup that can be anything (a styled JTable looks like a good idea here, as you can set editors there that react on the first click), either by subclassing the JComboBox or maybe it is easier to build a custom component that does this.
 
Jenkin Zheng
Greenhorn
Posts: 12
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hauke Ingmar Schmidt wrote:This is not easily done with the standard JComboBox which uses a JList and a ListCellRenderer as popup (the part that becomes visible after clicking the down arrow). You need a combobox that creates a custom popup that can be anything (a styled JTable looks like a good idea here, as you can set editors there that react on the first click), either by subclassing the JComboBox or maybe it is easier to build a custom component that does this.

Thanks,thanks all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!