Results 1 to 6 of 6

Thread: JSeparator class of java

  1. #1
    Join Date
    Dec 2009
    Posts
    38

    JSeparator class of java

    Hello friends,

    I am new to the advanced java programming. There are some class concepts of java which are not cleared for me. One of them is 'JSeparator class'. I am unable to understand the use of JSeparator class of advanced java. It's method are also strange for me. Do you have sound knowledge about 'JSeparator class' of java? If yes then please try to share it with me. I would greatly appreciate your any help over this issue.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: JSeparator class of java

    Hi,

    JSeparator class provides a general purpose component for implementing divider lines - most commonly used as a divider between menu items that breaks them up into logical groupings. Instead of using JSeparator directly, you can use the JMenu or JPopupMenu addSeparator method to create and add a separator. JSeparators may also be used elsewhere in a GUI wherever a visual divider is useful.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: JSeparator class of java

    Hello friend,

    I suggest you to refer following java example to know about JSeparator class of java:
    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);
      }
    }

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: JSeparator class of java

    A JSeparator class of java has three nested class, which are as below:
    • Component.FlipBufferStrategy: This nested class of JSeparator is taken from "java.awt.Component" class
    • Container.AccessibleAWTContainer: This nested class of JSeparator is taken from "java.awt.Container" class
    • JComponent.AccessibleJComponent: This nested class of JSeparator is taken from "javax.swing.JComponent" class

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: JSeparator class of java

    Hi,

    Please study following example carefully, which will depict you the functionality of JSeparator class of java:
    Code:
    import javax.swing.JSeparator;
    import javax.swing.JFrame;
    
    public class SEPDM {
    
      public static void main(String[] acv){
        JFrame frameZ = new JFrame();
    
        frameZ.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
        frameZ.add(new JSeparator(JSeparator.VERTICAL));
    
        frameZ.setSize(4300, 200);
        frameZ.setVisible(true);
      }
    
    }

  6. #6
    Join Date
    Apr 2008
    Posts
    1,948

    Re: JSeparator class of java

    Following are some methods as well as the constructors of JSeparator class:
    1. setUI(SeparatorUI usi)
    2. setOrientation(int orntation)
    3. getAccessibleContext()
    4. JSeparator(int orntation)
    5. JSeparator()
    6. getUIClassID()

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. JCheckBoxMenuItem class of java
    By Ram Bharose in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 12:11 PM
  3. JDesktopPane class of java
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 08:14 AM
  4. What is TransferSupport Class in Java?
    By DANIEL 602 in forum Software Development
    Replies: 4
    Last Post: 13-02-2010, 06:54 AM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

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
  •  
Page generated in 1,714,145,197.13689 seconds with 16 queries