This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Implement this constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Implement this constructor" Watch "Implement this constructor" New topic
Author

Implement this constructor

Willie Toma
Ranch Hand

Joined: May 11, 2001
Posts: 78
I've been unable to run this code. I tried to implement this constructor in a class. Does anyone have any suggenstions? What i've tried hasn't worked.
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
Can you be more specific when you say you could not "run" this example? What happens? Compilation error? RunTime Error? The result is not what you expected?
W.
Bill Krieger
Ranch Hand

Joined: Sep 27, 2001
Posts: 53
Originally posted by Willie Toma:
[B]I've been unable to run this code. I tried to implement this constructor in a class. Does anyone have any suggenstions? What i've tried hasn't worked.
[/B]

Your GridbagDemo class doesn't explicitly extend any other class. Therefore super("GridBagLayout") will fail, as Object has no such constructor. Did you intend for this class to extend Frame?
Willie Toma
Ranch Hand

Joined: May 11, 2001
Posts: 78
It was an incomplete example that was in a book.
To display the example I tried to place it in the following block of code.
[CODE]
import java.awt.*;
import java.awt.event.*;
class GridBag extends Frame{
public static void main(String[] args){
new GridBagDemo().show();
}
// Example code here
}
Is this the correct way to go about this. Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implement this constructor