• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Menu based on text

 
Greenhorn
Posts: 11
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I want to make menu on left side of frame, buttons'd be text...when clicked they'd open submenu and after that new jframe/panel...Hope you know what I want...
I read lots of examples but they wasn't what I wanted..most of them was on upper side..opening while clicked(I want it to be there opened all time while program is running)...
Please answer!
Thanks!
 
Sheriff
Posts: 26777
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, of course your "menu" can't be a JMenu because that automatically goes at the top of the frame with dropdowns and so on, and you said you didn't want that.

But you can still create a JPanel whose layout manager splits it into two parts vertically. In the left part is where you want your menu buttons, correct? So in the left pane you would use a layout manager which arranged your menu buttons in a vertical list. Although you mentioned "submenus", so maybe you should have a JTree there with your menu options.

At any rate you should go through the Swing tutorial, especially the parts which cover the common layout managers, so you have a better idea of what things are possible.
 
Lovro Posaric
Greenhorn
Posts: 11
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


In the left part is where you want your menu buttons, correct?


Yes and no, I want them look like just text that is clickable..I mean, when you click on it, it opens some window or so...
 
Marshal
Posts: 74049
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably still want buttons, then. But see if you can take the borders off the buttons, so only the text remains visible.
 
Lovro Posaric
Greenhorn
Posts: 11
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for answers!

this worked, but when I click on button it becomes blue(eclipse's default) until cursor is on it...
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic