Solved

JFC

Posted on 1998-03-09
4
228 Views
Last Modified: 2013-11-23
Currently my application is in JDK1.1.5. I want to port it to JDK1.2.
I want to use Swing components in my application.
I have been using setLayout(null) method for absolute placing of the components.
setLayout(null) doesn't seem to work in JFC.

Is there any alternative for absolute placing of components.(i.e. any alternative method in Swing for setLayout(null) method.

Cheers swamy

0
Comment
Question by:sswami
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:wcrosman
ID: 1233484
I'd strongly recommend using layout managers.  Your current technique will not
work properly on differing platforms and screen resolutions.
0
 

Expert Comment

by:markoj
ID: 1233485
JFC works with null layout. I use it all the time.
Example:
 JButton button = new JButton("OK");
 button.setSize(100, 100);     // you can use button.reshape(100, 100, 100, 100) instead
 button.setLocation(100, 100);
 this.add(button);
0
 

Author Comment

by:sswami
ID: 1233486
The JFC doesn't work with null layout if your class extends JFrame.

Any other workaround.....

Cheers swamy
0
 

Accepted Solution

by:
markoj earned 50 total points
ID: 1233487
Add JPanel to your JFrame. (MyJFrame.getContentPane().add(new MyJPanel)).
JPanel works with null layout.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question