Plz solve my problem . I want to display table on a frame & I am able to display but not with proper size & position . How can I do this ? Plz provide code if possible
Object[][] data = { {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)}, {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)}, {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)}, {"Mark", "Andrews", "Speed reading", new Integer(20), new Boolean(true)}, {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)} };
My final aim is to display all the records of a particular student on a frame . Imagine the frame would be like this : On the top-middle there will be student name in big font . then in middle a table includes all the marks of that student .after then in bottom some more details about student & a button that will have the functionality of getting printout of this frame .
Accrding to ur solution I am able to control position of table( not completely ) but not the size like the table should escape some space from the both side ( left & right ) .
Any body if have any solution then post ASAP . Thanks ,
Object[][] data = { {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)}, {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)}, {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)}, {"Mark", "Andrews", "Speed reading", new Integer(20), new Boolean(true)}, {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)} };
Object[][] data = { {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)}, {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)}, {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)}, {"Mark", "Andrews", "Speed reading", new Integer(20), new Boolean(true)}, {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)} };
I have just tried your code but it is displaying just a dash in middle ( no table , no anything ) . Please give one more try ... Any help is welcome ...
ravi v kumar
Ranch Hand
Joined: Dec 14, 2004
Posts: 56
posted
0
check once,
here its is working for me
Nigel Browne
Ranch Hand
Joined: May 15, 2001
Posts: 673
posted
0
I have rewritten vavilipalli's code using a constructor rather than the show method to initialize the JTable.
ravi v kumar
Ranch Hand
Joined: Dec 14, 2004
Posts: 56
posted
0
did u got ur problem solved...?
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
Hi RK ,
when I comment this line then I am getting table & a textfield on a frame . but then also my problem remains the same . I am not able to control size .