Here are the methods I'd created so far
Expand|Select|Wrap|Line Numbers
- private TextField createTextField(String text, String name, int cols)
- {
- TextField nextTextField = new TextField(text, cols);
- nextTextField.setName(name); //for me to have something simple to refer to this object later on
- return nextTextField;
- }
Expand|Select|Wrap|Line Numbers
- private Component getByName(String componentName, Container cont)
- {
- for(Component c : cont.getComponents())
- {
- System.out.println(c.getName()); //to be able to see where the search is going
- if(c.getName() == componentName)
- {
- return this.getComponentAt(c.getLocation());
- }
- }
- return null;
- }
Expand|Select|Wrap|Line Numbers
- getByName("Nickname", leftPanel).setForeground(Color.orange);
The question is, what do i do wrong?
Any clue would be much appreciated!
Thank you:)