Example usage for javax.swing Box getAccessibleContext

List of usage examples for javax.swing Box getAccessibleContext

Introduction

In this page you can find the example usage for javax.swing Box getAccessibleContext.

Prototype

@BeanProperty(bound = false)
public AccessibleContext getAccessibleContext() 

Source Link

Document

Gets the AccessibleContext associated with this Box.

Usage

From source file:Main.java

public static void main(String args[]) {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Box rowOne = Box.createHorizontalBox();
    rowOne.add(new JLabel("Username"));
    rowOne.add(new JTextField());
    Box rowTwo = Box.createHorizontalBox();
    AccessibleContext context = rowTwo.getAccessibleContext();
    System.out.println(context);/*from   w  w  w  .  ja  v a 2 s .c om*/

    rowTwo.add(new JLabel("Password"));
    rowTwo.add(new JPasswordField());
    f.add(rowOne, BorderLayout.NORTH);
    f.add(rowTwo, BorderLayout.SOUTH);
    f.setSize(300, 200);
    f.setVisible(true);
}