How can we add JTable in JPanel with null layout

0 votes

We want to add JTable into JPanel whose layout is nullJPanel contains other components. We have to add JTable at proper positions

Jun 1, 2018 in Java by sharth
• 3,370 points
1,425 views

1 answer to this question.

0 votes
The JPanel should have some layout manager.

JTable should be added into the JScrollPane which actually should be added into the JPanel.

If we don't care about the precision of components size you can use pure BorderLayout and combine it with FlowLayout and GridLayout. if you need precision - use jgoodies FormLayout.

The FormLayout is really tricky one, but you can play a little with WindowBuilder (which is embedded into Eclipse) and a look at the code it generates. It may look complicated but it is just an ignorance
answered Jun 1, 2018 by Parth
• 4,640 points

Related Questions In Java

0 votes
2 answers

How can we add leading zeros to the number in Java?

From Java 1.5 you can use the String.format method. ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 59,230 points
5,169 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,920 points
11,798 views
0 votes
4 answers

How can we display an output of float data with 2 decimal places in java? Please help

You can use DecimalFormat. One way to use ...READ MORE

answered Dec 16, 2020 in Java by Gitika
• 65,770 points
164,498 views
0 votes
3 answers

How can I add new elements to an Array in Java

String[] source = new String[] { "a", ...READ MORE

answered Sep 19, 2018 in Java by Sushmita
• 6,920 points
13,212 views
0 votes
1 answer

Uipath string null

There are many different approaches and idea ...READ MORE

answered Jun 1, 2018 in RPA by wrecker
• 3,110 points
3,891 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 81,245 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
8,365 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points
17,444 views
0 votes
2 answers

How can we add an image to a JPanel?

If you are using JPanels, then are ...READ MORE

answered Sep 20, 2018 in Java by Daisy
• 8,140 points
11,688 views
0 votes
6 answers

How can we define global variables in java?

To define Global Variable you can make ...READ MORE

answered Dec 15, 2020 in Java by Gitika
• 65,770 points
117,881 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP