Solved

getPreferredSize

Posted on 2001-06-08
2
155 Views
Last Modified: 2010-03-31
What determines/changes the "preferred size?"
0
Comment
Question by:menubar
2 Comments
 

Expert Comment

by:smileyxx
ID: 6168984
If you subclass Component, you can do it yourself by overriding the getPreferredSize() method.
0
 
LVL 3

Accepted Solution

by:
superschlonz earned 20 total points
ID: 6169397
Components should calculate their preferred size from the text and other stuff they display.
Containers have a Layout which calculates the preferred size from the values the components in
this container return.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
windows explorer path to command prompt 5 54
difference of if loops 23 62
eclipse apache tomcat admin console 52 123
type mismatch (Object[] to double[] 4 33
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 implement Singleton Design Pattern in Java.

821 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