Adam
Adam

Reputation: 9049

Blackberry: invoke constructor for verticalfieldmanager

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

Answers (1)

donturner
donturner

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

Related Questions