问题
I'm using NetBeans. How I can make all components from my window to resize to actual size of the window? Now when my window is 800x600 and I make it larger, size of all components are the same. I would like to change size of my components when I change size of open application window.
I tried to search for answer on the internet but I couldn't find good answer to my problem.
回答1:
I tried to search for answer on the internet but I couldn't find good answer to my problem.
I find that hard to believe.
Almost every other question in the forums is about laying out components. The standard answer is to use a Layout Manager. Read the section from the Swing tutorial on Using Layout Managers for more information. We can't give specific information because we have no idea what your GUI looks like.
来源:https://stackoverflow.com/questions/15868553/fit-all-components-from-jframe-to-actual-size-of-window