152 consoleTextArea.setEditable(false);
153 consoleTextArea.setFont(Font.decode("Monospaced"));
154
155 tabbedPane.setTabPlacement(JTabbedPane.TOP);156 tabbedPane.add("Abstract Syntax Tree", astTreeScrollPane);
157 tabbedPane.add("XML", xmlScrollPane);
158 tabbedPane.add("Console", consoleScrollPane);
138
139 private void initComponents() {
140 setSize(1000, 700);
141 setDefaultCloseOperation(ToolkitViewImpl.EXIT_ON_CLOSE);142
143 setLayout(new BorderLayout(0, 5));
144
Non-private static members of the parent class are accessible by child classes. However, it is a bad practice to do so, because it obscures where a value was actually declared. Always use only the declaring class to access static members.
class SomeClass {
static Object staticData = null;
}
class SomeChildClass {
public void method() {
// Accessing the static value declared within the parent class through the child class.
SomeChildClass.staticData = this;
}
}
class SomeChildClass {
public void method() {
// We are now accessing the static value through the parent class.
SomeClass.staticData = this;
}
}