• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Implement this constructor

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic