Custom Java tool tip with Swing components as content does not show up

后端 未结 6 775
忘掉有多难
忘掉有多难 2020-12-09 10:42

I\'m trying to show multiple images in a component\'s tooltip, found createToolTip() and implemented a custom that adds the needed components like this:

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 11:21

    It might sound silly but, have you tried setting bounds for JPanel ?

    setBounds(100, 100, 150, 50);
    

    And you can try setting a gap between components in BorderLayout

    JPanel content = new JPanel(new BorderLayout(1,1));
    

提交回复
热议问题