Reputation: 9049
I want to run the constructor of a vertical field manager when used in a mainscreen:
vfm = new VerticalFieldManager(){
protected void VerticalFieldManager(){
System.out.println("Fresh");
}
protected void sublayout(int maxWidth, int maxHeight){
super.sublayout(maxWidth, 420);
setExtent(maxWidth,420);
}
};
Of course, VerticalFieldManager does not work.
Upvotes: 0
Views: 93
Reputation: 19146
You cannot have a constructor in an anonymous class, that's just one of the rules of Java.
If you need to override the VerticalFieldManager
constructor you will need to create your own class which extends VerticalFieldManager
.
Upvotes: 5