How to set the minimum width of the Tool Window
Answered
I added a JTabbedPane in the Tool Window and set the minimum width of the JTabbedPane, But it did not work.
class InsightsPanel(project: Project) : JTabbedPane() {
init {
this.add("Overview", OverviewPanel(project))
this.add("Hourly", CommitsHourPanel(project))
this.add("Weekly", CommitsWeekdayPanel(project))
this.add("Monthly", CommitsMonthPanel(project))
this.add("Timezone", CommitsTimezonePanel(project))
this.add("Project Top(N)", CommitsProjectPanel(project))
}
override fun getMinimumSize(): Dimension {
return Dimension(800, 200)
}
}
Please sign in to leave a comment.
Hi,
It is not possible to enforce minimal tool window size. It is up to users to resize it to their needs.
If you want to set an initial size, you can try: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000491050-How-to-dynamically-set-the-width-of-the-Tool-Window