Thanks guys.

Ok, i got the error in the constructor. Now it sounds like this:

> public class MyMenuBar extends MenuBar {

// super constructor
public MyMenuBar(boolean bool) {
         super(bool);
} ;



But still i got the same ClassCastException.

root    is a MenuItem   and    root.getSubMenu() return a MenuBar
object.




On 19 Ott, 17:39, ep <[email protected]> wrote:
> where do you make new MyMenuBar() and how do you provide it to the
> "root" member? and what type is root actually?
>
> On 19 Okt., 17:14, alexoffspring <[email protected]> wrote:
>
>
>
> > I created a public class MyMenuBar   just to use the getItems()
> > method, which is protected in MenuBar:
> > ........
> > public class MyMenuBar extends MenuBar {
>
> >         // super constructor
> >         public MyMenuBar(boolean bool) {
> >                 new MenuBar(bool);
> >         }
>
> >         // the super.getItems() is protected
> >         public List<MenuItem> getItems() {
> >                 return super.getItems();
> >         }
>
> > };
>
> > ........
>
> > I don't understand why a get a   java.lang.ClassCastException  when i
> > try to cast a MenuBar into a MyMenuBar:
>
> > .........
> > MenuBar menuBar = root.getSubMenu();
> > local_mmb = ((MyMenuBar) menuBar).getItems();
> > ........
>
> > Where am i wrong?- Nascondi testo citato
>
> - Mostra testo citato -

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to