JToolBar in Java Swing

Home  »  Java  »  Advance Java  »  Java Swing II  »  JToolBar


A JToolbar contains a number of components whose type is usually some kind of button which can also include separators to group related components within the toolbar. The toolbar can be docked against any of the four edges of a container (panel or a frame). A toolbar can also be made to float. Toolbars uses BoxLayout, which arranges components in one horizontal row/ vertical column. This layout manager does not force each component to have the same height or width; instead, it uses their preferred height or width, and attempts to align them. You can adjust the resulting alignment by calling class Component's methods setAlignmentX() and/or setAlignmentY() on each component.

JToolBar Constructor

JToolBar()
Creates a new tool bar; orientation defaults to HORIZONTAL.

JToolBar(int orientation)
Creates a new tool bar with the specified orientation.

JToolBar(String name)
Creates a new tool bar with the specified name.

JToolBar(String name, int orientation)
Creates a new tool bar with a specified name and orientation.


Simple Example of JToolBar in Java Swing.



C:\>jdk1.4\bin>javac JToolBarDemo.java
C:\>jdk1.4\bin>java JToolBarDemo



Displaying JToolBarDemo in Swing


Download Complete Program

  -  



Java Swing-II


JOptionPane Class Input Dialog Boxes JSliders
JProgressBars JTables JTabbedPane
JMenu JPopupMenu JToolBar
JFileChooser JScrollBar JScrollPane
JRootPane JTextPane JTree
JSplitPane JDesktopPane JEditorPane




9 comments:

  1. Thanks for given information about above concept all the details
    are very useful.jToolbar to design web page in future concept to make beautifully.Very good brief and this post helped me alot. Say thank you I searching for your facts.

    DevOps Training in Chennai

    DevOps Online Training in Chennai

    DevOps Training in Bangalore

    DevOps Training in Hyderabad

    DevOps Training in Coimbatore

    DevOps Training

    DevOps Online Training

    ReplyDelete
  2. After reading your blog I was amazed. The blog was explained clearly. And I hope all other readers will understand and experience how I felt after reading such a wonderful blog.
    IELTS Coaching in chennai

    German Classes in Chennai

    GRE Coaching Classes in Chennai

    TOEFL Coaching in Chennai

    spoken english classes in chennai | Communication training


    ReplyDelete
  3. Great site and a great topic as well I really get amazed to read this.This is incredible,I feel really happy to have seen your webpage.I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.



    AWS Course in Chennai

    AWS Course in Bangalore

    AWS Course in Hyderabad

    AWS Course in Coimbatore

    AWS Course

    AWS Certification Course

    AWS Certification Training

    AWS Online Training

    AWS Training

    ReplyDelete
  4. Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.This is incredible,I feel really happy to have seen your webpage.I gained many unknown information, the way you have clearly explained is really fantastic.


    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore


    ReplyDelete
  5. I like the phrase “Secret Skills” because it implies skills you have that YOU may think don't matter. ... Skill – something you can do that has been cultivated through experience to do well. Talent – a unique expression of a skill. Something you do well in a way that is not common to others.thanks !!

    Android Training in Chennai

    Android Online Training in Chennai

    Android Training in Bangalore

    Android Training in Hyderabad

    Android Training in Coimbatore

    Android Training

    Android Online Training

    ReplyDelete