Member-only story
Controlling the Size of IntelliJ Plugin Tool Windows
In the previous two articles, I explained how to set up a custom IntelliJ plugin tool window and add components to it. These tutorials focus on the basics of creating your own plugin and therefore may be a obvious to anyone with prior java knowledge.
- Adding a ToolWindow to an IntelliJ Plugin | by Banjoe | Feb, 2023 | Medium
- Adding Swing UI Components to an IntelliJ Tool Window | by Banjoe | Feb, 2023 | Medium
In this article, I will briefly explain how to control the size of the contents in a plugin tool window. Since it’s not currently possible to give the tool window a fixed size, we need to focus on the size attributes of the JComponents we place inside the tool window.
Overview of Size Properties
All JComponents have minimum, maximum, and preferred size properties that can be updated programmatically:
FlutterFastPanel.setMaximumSize(new Dimension(500, 500));
Or in the IntelliJ GUI designer:
These properties take a Dimension object that specifies a width and height as integer values. These values can be positive or negative, where negative values indicate an unrestricted constraint.