473,513 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set preferredSize of a Panel

Hello, I am trying to set the preferredSize of a panel but am having some
problems.

I have created a class that extends Panel and included the getPreferredSize
method (so it overides the original) which returns a new Dimension. In the
main Applet class I have used getPreferredSize() to try and call this
method.
When a try to create a getPreferredSize in the extended class, I get an
error sating cannot overide getPreferred Size? Why not?

Why does Panel only have a getPreferredSize method and not a
setPreferredSize as well.

Thanks
Andrew
Jul 17 '05 #1
1 4277
Andrew wrote:
Hello, I am trying to set the preferredSize of a panel but am having some
problems.

I have created a class that extends Panel and included the getPreferredSize
method (so it overides the original) which returns a new Dimension. In the
main Applet class I have used getPreferredSize() to try and call this
method.
When a try to create a getPreferredSize in the extended class, I get an
error sating cannot overide getPreferred Size? Why not?

Why does Panel only have a getPreferredSize method and not a
setPreferredSize as well.


Andrew,

Please post the code (as small as possible) and the error message from
the compiler. Then someone will almost assuredly be able to help.

Ray

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10821
by: Fabrizio | last post by:
Hi, There is any chance to insert a control like a text box in a panel choosing the absolute position? When I try to insert a label , the panel positions the control on a locked position. Thanks...
9
3166
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
2142
by: Peteroid | last post by:
When the application I'm working on is run it creates a panel with a Paint event customized to draw primitives (circles, rectangles, etc.), places the panel on a form, and then launches the form....
1
2138
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
3
3203
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a...
10
35874
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
8
5337
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
11
11240
by: dongarbage | last post by:
Hi there, I'm very much a C# novice. How do you do freehand drawing on a panel with a mouse in c#? Thanks, Don
1
3099
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, In a C#.Net2.0 Winforms application I have some combo boxes. I ind these boxes to enum values and then call ComboBox.Size = ComboBox.PreferredSize: But, the combo box is never wide enough to...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.