List of usage examples for javax.accessibility AccessibleRelation AccessibleRelation
public AccessibleRelation(String key, Object[] target)
From source file:MainClass.java
MainClass() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel p = new JPanel(); p.setPreferredSize(new Dimension(300, 50)); JLabel jl = new JLabel("Name:"); p.add(jl);/*from www. j a v a 2 s. com*/ JTextField jtf = new JTextField(20); jtf.getAccessibleContext().setAccessibleName("Name-entry"); p.add(jtf); AccessibleRelation ar = new AccessibleRelation("connector", jtf); AccessibleContext ac = jl.getAccessibleContext(); ac.getAccessibleRelationSet().add(ar); getContentPane().add(p); pack(); setVisible(true); }