Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java development question....

Status
Not open for further replies.

Chadi

Programmer
Oct 16, 2000
7
CA
In my project,I have four Jframe in wich the pricipal one is JtabbedPane with 4 pages. what should I do for my 4 pages contain the 4 Jframes? What is the method I should use to put a Jframe in a page?<br><br>Thank you for your time in advance, and I would appreciate a quick reply...<br><br>In the future, If anybody needs any help.,I'll be here to lend hand...
 
What do you mean by 'JTabbedPane with 4 pages'. Is a page a tab panel or what? If so, why do you want a JFrame in a tab panel?
 
Hi octopus! thanks fo your time...:D<br><br>I realise my question wasn't clearly asked lasttime around, and i apologize... <br><br>Basically, my question was: How do i put a Jframe in a JTabbedPane?
 
I think if i understand your question correctely, this is actually what you want.<br><A HREF=" TARGET="_new"> on how to use JTabbedPane, as far as i can tell you would build your project this way.<br>JFrame-&gt;JPanel-&gt;JTabbedPane-&gt;Then you can switch between multiple components, which would allow for a variety of buttons, checkboxes in seperate order.&nbsp;&nbsp;<br>Again, i didn't test this code so im am not positive :(<br><br>One other thing you can try, if you are having trouble getting the buttons,checkboxes to look correctely, you can try this hack.<br>class Proj6Panel extends extends JPanel <br><br>Proj6Panel()<br>{<br>setLayout(null);<br><br>}<br>then in the pain component function you can position buttons etc.. with an x,y,width,height positioning<br>public void paintComponent(Graphics screen)<br>{<br>JButton whatever = new JButton();<br>whatever.setBounds(x,y,width,height);<br>}<br>In the book i got this from it said only to do it if there was no other way to do it.&nbsp;&nbsp;I think it messes with swings handling of the graphic components ??????????<br><br>good luck and email me if you get to work :)<br> <p>ackka<br><a href=mailto:tmoses@iname.com>tmoses@iname.com</a><br><a href= my site</a><br>"In the beginning there was HTML, and it was good"<br>
by Nick Heinle, Designing with JavaScript<br>
<br>
<br>
 
Right; you're only supposed to use a null layout manager if no other layout manager can do what you want. Layout Managers are much more efficient in the way they handle and position things, and chances are can do what you want with (in the end) less trouble. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top