Resizing issue with canvas within jscrollpane within jsplitpane

后端 未结 3 969
忘了有多久
忘了有多久 2020-11-22 03:28

I\'m creating an application using the NetBeans GUI Editor, in which I want to have a JSplitPane, the top component of which will be a Canvas withi

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 04:02

    After reading the comment by davidbuzatto I googled about mixing AWT and Swing components and I was a little surprissed to find out that it is such a bad practice.

    I found the most accurate answer to my question here

    Heavyweight components have their own Z-ordering. This is the reason why Swing and AWT cannot be combined in a single container. If they are, the AWT components will be drawn on TOP of Swing components.

    For example: When AWT components are used with JtabbedPane, they do not disappear when the tabs are switched.

    Thanks davidbuzatto for showing me the way :-)

提交回复
热议问题