Results 1 to 3 of 3

Thread: JSeparator class of java

  1. #1
    PerryCollins is offline Senior Member
    Join Date
    Dec 2009
    Posts
    380
    Rep Power
    3

    Default JSeparator class of java

    I am learning java programming and I want to know about 'JSeparator class'. I want to know use of JSeparator class of advanced java. Any help would be appreciated.

  2. #2
    SmithJohnson is offline Senior Member
    Join Date
    Dec 2009
    Posts
    364
    Rep Power
    3

    Default

    This class gives general purpose part for implementing divider lines generally utilized as divider among menu items that breaks them up into logical groupings. Rather than using JSeparator, use JMenu or JPopupMenu addSeparator method to make and include separator. JSeparators also utilized somewhere else in GUI where visual divider is helpful.

  3. #3
    Williamsjones is offline Senior Member
    Join Date
    Dec 2009
    Posts
    352
    Rep Power
    3

    Default

    See the code given below which may be useful for you:

    Code:
    import javax.swing.JSeparator;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    
    public class JSeparatorDemo {
      public static void main(String argsb[]) {
        JFrame fn = new JFrame("JSeparator Sample");
        fn.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        fn.setLayout(new GridLayout(0, 1));
        JLabel abovec = new JLabel("Above Separator");
        fn.add(abovec);
        JSeparator separator = new JSeparator();
        fn.add(separator);
        JLabel belown = new JLabel("Below Separator");
        fn.add(belown);
        fn.setSize(300, 100);
        fn.setVisible(true);
      }
    }

Similar Threads

  1. Polygon class in JAVA
    By Shane Robinson in forum Programming
    Replies: 2
    Last Post: 07-04-2010, 06:21 AM
  2. TextComponent class in java
    By TorresScott in forum Programming
    Replies: 3
    Last Post: 06-18-2010, 01:43 PM
  3. Using MediaTracker class in JAVA
    By MyersGray in forum Programming
    Replies: 2
    Last Post: 04-01-2010, 02:02 PM
  4. FileWriter class in JAVA
    By Theodosia Goodman in forum Programming
    Replies: 2
    Last Post: 03-30-2010, 12:37 PM
  5. TextComponent class in java
    By AllenBrown in forum Programming
    Replies: 2
    Last Post: 03-08-2010, 01:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48