Solved

JFC

Posted on 1998-03-09
4
224 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 79
eclipse java  build path 6 44
Syntax Error 2 46
even odd program using while loop 3 29
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now