Layouts were invented so one doesn’t ’t have to compute sizes.  If one learns to use the right layouts, panels continue to look good when windows need to be resized because of screen resolution changes, font changes, language changes, etc.
E.g. what will an application with null layouts look like to a visually impaired person who globally changes the app font size from the 14pt size assumed in all positioning to 36pt?

Swing/AWT has lots of layout classes, but I’ve been writing applications in Swing for almost 30 years and I really only ever use 3: GridbagLayout, BorderLayout, and FlowLayout. If I remember correctly,  the original Netbeans GUI editor, Matisse, defaulted to using no layout but did a great job when one switched to GridBagLayout.  Much later, a new layout (Spring?) was added and I think the GUI editor eventually defaulted to it.  That layout manager, in my opinion, was only ever good for creating screens with a GUI builder - manually writing code with it was more cumbersome than with the above mentioned layout managers.  At least to me.

Anyway - that’s my long winded explanation for why layout managers are your friend 😀

On Jan 14, 2023, at 11:39 PM, Tim de Vries <tecrea...@gmail.com> wrote:

I use a SizedPanel extends JPanel for null Layout and it works for all my needs. But you have to compute sizing yourself. I use it that way for both BoundingBox’es and GUI components. I use it in Swing and Awt. I use a mix of both or it doesn’t work correctly. It all works properly. There used to be some issues with doLayout, but after not calling the doLayout method and calling tec_layout, that code shadowing problem went away, similar with what goes on with spring framework transitive dependencies, but that’s another story.

Tim



Sent from my iPhone

On Jan 13, 2023, at 8:07 AM, Thomas Wolf <tjw...@gmail.com> wrote:

You are using code - it’s just that the NB GUI editor creates the Java code for you.   The height of the combobox is constrained by how much space the containing panel is giving it.  In other words, it doesn’t matter how tall you tell the combo box to be, if the panel doesn’t give it that much space, it’s irrelevant.  I would look into that.  I can’t help you any more since you’re not familiar with the basics of how Java Swing works nor how the NB GUI editor works.  I would read up on Java Layout management.

Good luck,
Tom


On Jan 12, 2023, at 11:06 PM, Murali Govind <murali...@gmail.com> wrote:

Hi

Thanks for responding. I am not using any code. I am using the GUI component.

<PastedGraphic-1.png>

I don’t know which of the properties will change the way it looks.

Regards
Murali

On 12 Jan 2023, at 8:09 PM, Thomas Wolf <tjw...@gmail.com> wrote:

Like I said earlier, it might be a layout issue.  Saying “help” isn’t enough detail for anyone to actually help.  You have to actually post the code that has the problem for people to try and help.  Like the snippet of your code that creates the panel that has the combo box that has the problem.
Tom

On Jan 12, 2023, at 2:46 AM, Murali Govind <murali...@gmail.com> wrote:

Hi

Apologies for the delay. I have tried all size like properties to make the letters visible. None of them seem to work. Would you happen to know which property I need to set?

Regards
Murali

On 6 Jan 2023, at 8:28 PM, Thomas Wolf <tjw...@gmail.com> wrote:

Not enough detail, but it looks like you’re not giving the combo box enough space to size itself around the size of the container items. Check the layout and/or size of the surrounding panel(s).

Hope that helps
Tom

On Jan 5, 2023, at 10:25 PM, Murali Govind <murali...@gmail.com> wrote:

Hi

I am able to change the size of the combobox. I can change the size of font also. But the area inside the combobox where the text is displayed remains the same size. As a result it truncates the text.

<PastedGraphic-1.png>

Anyone can help how to fix it?

Regards
Murali



Reply via email to