JonathanGiles / jonathangiles.net-comments

0 stars 0 forks source link

posts/2009/javafx-menubar-control/index #119

Open JonathanGiles opened 4 years ago

JonathanGiles commented 4 years ago

JavaFX Menubar control

https://jonathangiles.net/posts/2009/javafx-menubar-control/

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Paul Comment posted on: July 26, 2009

...and clicking outside the menu should close it :)

JonathanGiles commented 4 years ago

Auto-imported comment, original author: PhiLho Comment posted on: July 27, 2009

Good. Should at least display the menu item choice in the application, except for Exit, we don't have much feedback. Might be superseded by some official menu system in next version (hopefully) but yet a good training, as you point out.

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 27, 2009

The result of clicking on any menuitem is a call to the action function. To debug I have the menuitems printing to the console. A developer using a menu like this of course hooks in proper actions, but for testing purposes the current actions meet my requirements.

Cheers, Jonathan

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 27, 2009

Yes, I agree :-) I haven't yet looked into losing/gaining focus, but it's on my todo list.

Cheers, Jonathan

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Tbee Comment posted on: July 27, 2009

And it should have transparency, a sidebar effect, and rounded corners ;-b

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 27, 2009

Hehe, well, if I ever make it available feel free to skin it to look like this :-) My design preferences are always minimalistic - I like clean borders and straight lines.

What do you mean by a sidebar effect?

Cheers, Jonathan

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Tbee Comment posted on: July 27, 2009

He he. Just pulling your leg.

Sidebar effect; if you take a peek at the Synthetica link I sent you yesterday, you'll see that when a menu is unfolded, the left side (where the icons are placed) is visually separated from the menu item texts.

(I just installed JavaFX in my JFX development environment... I'm getting somewhere on that component)

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 27, 2009

Ah right, I was actually thinking of adding the 'sidebar' effect also - I like how in many windows apps this is done - it makes the GUI nicer looking.

When I find time I'll certainly look into adding it.

Thanks.

JonathanGiles commented 4 years ago

Auto-imported comment, original author: PhiLho Comment posted on: July 28, 2009

Ah, OK, for some reason the Java console status went to "Hidden" while I usually keep it "Always open", so I missed this feedback. Thanks for pointing it out.

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Haining Henry Zhang Comment posted on: July 28, 2009

Nice work! I do hope your menu APIs can turn into something usable in practice, because the JavaFX team at Sun leaves this homework for us. :)

As a side note, I wrote a demo on using SWING menu in JavaFX. Here is the link:

http://www.javafxgame.com/building-menu-in-javafx/

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 28, 2009

Thanks for the link! I'll include it in next weeks links post :-)

JonathanGiles commented 4 years ago

Auto-imported comment, original author: phoenix Comment posted on: January 22, 2010

Heyy the codes link is not working.. only the "Play it here" link is working ... :(

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: January 25, 2010

Thanks for the info - it's been fixed up. Note that this menu control is relatively dated and better stuff is most probably coming up in JavaFX 1.3.

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Yuriy Comment posted on: March 18, 2010

Hello, I tried your code in NetBeans6.8, but JFXtras-0.5.jar from http://code.google.com/p/jfxtras/ seems not to contain : org.jfxtras.scene.XScene; org.jfxtras.scene.layout.XVBox; org.jfxtras.scene.menu.CheckedMenuItem; org.jfxtras.scene.menu.Menu; org.jfxtras.scene.menu.MenuItem; org.jfxtras.scene.menu.MenuSeparator; org.jfxtras.scene.menu.MenuBar; What is the solution ?

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: March 22, 2010

You will need to get in touch directly with the JFXtras people as I'm not overly involved in their current efforts. Sorry.

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Yuriy Comment posted on: March 23, 2010

thanks