Creating Java dialogs

后端 未结 5 1791
梦如初夏
梦如初夏 2020-12-18 11:53

What would be the easiest way for creating a dialog:

  • in one window I\'m giving data for envelope addressing, also set font type from list of sizes
  • w
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 12:31

    You can use JOptionPane. You can add any Swing component to it.

    Create a panel with all the components you need except for the buttons and then add the panel to the option pane. The only problem with this approach is that focus will be on the buttons by default. To solve this problem see the solution presented by Dialog Focus.

提交回复
热议问题