Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable not adding to JScrollPane...WHY ?  RSS feed

 
Sherry Jacob
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats wrong with this class ? The table is not being added to the scrollpane...

 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am Nabi bux from university of sindh jamshoro (pakistan)
I am student BCIT my emailis jeo_baloch@yahoo.com
The write solution of your code is given below it may help you
thanks
(Jeay sindh)

the last code of your programe must be as
getcontentpane().add(sp);
i will help you i hope
 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also use the show();
method at the end of contructor and also use pakch();or setSize(400,400);
method
please refer java swing orelly book
 
Sherry Jacob
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by nabi bux:
also use the show();
method at the end of contructor and also use pakch();or setSize(400,400);
method
please refer java swing orelly book


Hi Nabi,
Thanks for your help. Though I couldn't understand much of what you tried to explain. I'll make the problem more clear...what I have designed is simply a class. The show() method for this class is being called from another class by creating an object of this class there. So there are basically no issues with the show() method coz that's just fine.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What nabi wrote is rather... fanciful. Let's set those worries aside for a moment.

This looks fine to me; in fact, I cut, pasted, and ran it with a main like

public static void main(String[] argv) { new frame2().setVisible(true); }

and it worked perfectly. The table showed up as expected. So it's not working for you?
 
Leonardo Rafaeli
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have u tried make with other layout?

Ex.: With... ahn... BORDER layout xD (only to u try and test if this works or not)



i've put "this" cauz', for me, the code are "more clean" and is more easy to understand the code... so good luck, if u want more help, pvt-me and we will talk
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!