Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6364045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:06:51+00:00 2026-05-25T00:06:51+00:00

I have a fairly complicated JTable subclass ( WidgetTable and its WidgetTableModel ) that

  • 0

I have a fairly complicated JTable subclass (WidgetTable and its WidgetTableModel) that works fine when I add it to a dummy JPanel for testing purposes.

Since I am absolutely horrid at working with LayoutManagers, I like to use the NetBeans built-in GUI Builder for all my layout work. Then I usually just code-around the autogenerated (GUI builder) code and that has always worked for me. It is the best of both worlds: I get my presentation looking exactly the way I want it, and I also get fine-grained control over the componentry.

However, I have never used the GUI Builder tool to make tables. After tinkering around with it for a while last night, it looks as though it is only good for making pretty basic (fixed # of rows, fixed # of columns, etc.) JTables.

My WidgetTable actually has a dynamic number of both rows and columns, special editors/renderers and many other bells and whistles.

My problem:

I have two conflicting constraints: (1) I need to use the GUI builder to position and size the table exactly where I want it in the container, but, (2) The table component available through the GUI builder is too basic to handle my WidgetTable.

I need a way to design a “table placeholder” into my container with the GUI builder, such that, once NetBeans autogenerates that placeholder code, I tweak the code and instruct it to dynamically instantiate one of my WidgetTables instead, consuming the location and size that I defined the placeholder component to take up.

This way I can have my cake, and eat it too. The only problem is, I don’t think the GUI builder supports this ability to drag-n-drop abstract JComponents, position and size them, and then plug subclasses into them elsewhere in the codebase.

Anybody ever have this problem before or have any interesting recommendations? I imagine the best thing to do would be for me to just roll up my sleeves and learn LayoutManagers, but I’m mostly a server-side developer and only come over to the client-side every once in a blue moon; and honestly, don’t have the energy to learn the intricacies and nastiness of GroupLayout and its sinister cousins.

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:06:52+00:00Added an answer on May 25, 2026 at 12:06 am

    Insert a JTable using the GUI builder, reset its model property to the default value, and tweak the construction code so that it looks like

    jTable1 = new WidgetTable(this.widgetTableModel);
    

    You may tweak the creation code by right-clicking on the JTable, selecting “Customize code”, choosing “custom creation” instead of “default code” in the first combo box, and typing the code for the constructor call.

    If you need your jTable1 variable to be of type WidgetTable rather than JTable, edit the “Variable declaration code” in the same dialog box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly complicated installer that I'm writing in Wix that has a
I have a fairly complicated linq query that returns an item and a string[]
I have a fairly complicated function that takes several double values that represent two
Just out of curiosity, for applications that have a fairly complicated module tree, would
I have a fairly complicated join query that I use with my database. Upon
I have a build process that creates an ear in a fairly complicated manner
I have an object under test that makes a fairly complicated call to a
I have a fairly complicated NSTextView subclass in one of my projects. I'm currently
I have a site that has a fairly complicated footer, see http://www.roadsafetyforchildren.co.uk/ , not
We have a fairly complicated GUI in windows forms using C# and .Net 2.0.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.