Hi,

Just looking for a bit of advice on image sizing.

I'm building a prototype application at the moment that consists of several panels; the main panel is a borderLayout, I have a panel displaying information in the south (the footer), the center panel shows a tabbed panel with the main application content and in the north region I have another panel that is a tableLayout consisting of 1 row and 3 cells. In the 3rd cell on the far right I have an image (a logo) that is 186 x 81 in size.

The footer and header regions (north and south) are fixed height and I've got this working fine; however, my problem is that I can't seem to get the image to size correctly for the width. I want the image to display exactly the size it is, i.e. 186 x 86 but the width is being reduced whilst the height is correct.

How can I size an image precisely so that is doesn't change no matter what the window size is or how big the containing cell is?

Thanks,

Craig

asked 05 May '13, 04:37

Craig's gravatar image

Craig
1.1k141
accept rate: 6%


In tableLayout cells, you can set childWidth and childHeight to fix component size.

link

answered 05 May '13, 04:40

oskansavli's gravatar image

oskansavli ♦♦
3604
accept rate: 45%

Works perfectly - thanks.

(05 May '13, 05:01) Craig
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×1

Asked: 05 May '13, 04:37

Seen: 770 times

Last updated: 05 May '13, 05:01


© Copyright Gerger 2017