Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pseay committed Feb 12, 2021
1 parent ba02c79 commit a0ae9e1
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,28 @@ class Hierarchy {
```

You may be wondering how to access the variables after you made them.
When you make a new HFrame, it automatically creates a Navigator with all the components according to their name.
When you make a new HFrame, it automatically creates a Navigator with all the components according to their name.

Here is an example:
```java
class NavEx {
public static void main(String[] args){
//...code above
Navigator nav = frame.getNavigator();

//SINGLES
//getting one component by name
JComponent button1 = nav.getSingle("button1");
//getting one component by name and class
HButton button1asButton = nav.getSingleByClass("button1", HButton.class);

//LISTS
//getting a list by name
List<JComponent> labels = nav.getList("label");
//getting list by class
List<JLabel> jLabels = nav.getListByClass(JLabel.class);
//getting list by name and class
List<JLabel> jLabelsNamedLabel = nav.getListByClass("label", JLabel.class);
}
}
```

0 comments on commit a0ae9e1

Please sign in to comment.