Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 1:21 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Feb 06, 2012 4:05 pm 
Offline

Joined: Thu Jan 19, 2012 5:57 pm
Posts: 6
http://wiki.l33tlabs.org/bin/view/TWL/I ... eBasedGame

I followed this tutorial in implementing TWL with Slick, but I've run into a query to do with overriding.

As far as I know, an override is meant to have the same return type and parameters as the method it is overriding.

But in that tutorial above, you have:

@Override
protected void createRootPane() {

But the extended class BasicTWLGameState has the method:

protected RootPane createRootPane() {

They have different return types, and therefore my NetBeans is complaining at me and saying it isn't a valid override.

In adddition, it says that 'rootPane' has private access in BasicTWLGameState, and therefore I can't access it in the context. I have to do 'getRootPane()' for it to not complain.

I'm kind of new to OOP + java sorry, so I'm probably missing out something simple.

Thank you for any help you can provide,

Thomas.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 7:03 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1173
I updated the example in the wiki.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group