PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, November 8, 2022

[FIXED] How to make a vertical side menu, Jmenus in swing?

 November 08, 2022     java, jmenu, menu, swing     No comments   

Issue

I'm relatively new to java swing, so I don't know to change the menu component in swing with a vertical one.


Solution

If you want a side menu with buttons, I imagine you probably want to use a JPanel with GridLayout. Something like:

JPanel p = new JPanel();
p.setLayout(new GridLayout(2,2));
Jlabel l = new JLabel("a");
p.add(l);
JButton btn = new JButton("click");
p.add (btn);
l = new JLabel("b");
p.add(l);
btn = new JButton("click");
p.add (btn);


Answered By - ControlAltDel
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing