Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable in a JInternalFrame

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to place a JTable inside a JInternalFrame, but it's not displaying the table. I tried a proof of concept, in case my complex table was the source of problems and got the same issue. I created a very simple table (the one in the JTable javadocs). I can display this table in a regular JFrame. I can also display various components, like JLabels and JButtons inside a JInternalFrame. I cannot display a JTable inside a JInternalFrame. Any ideas? Code is below...

(Just ignore the portfolio stuff, since i removed all that code.)
Any help is greatly appreciated.
--Mark
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I would do what you did

I commented out your Portfolio stuff so I could test compile.
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did it. Well, looking back, and comparing line by line I found at least one problem--some combination of JBuilder and me created both jtable1 and jTable1. Of course, this still doesn't explain why it didn't work the first time, when I did everything through the GUI, and so wasn't able to introduce other, similarly named variables.
In any case, thanks for your help Gregg. :-)

--Mark
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic