File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -1498,10 +1498,21 @@ public void actionPerformed(ActionEvent actionevent) {
1498
1498
}
1499
1499
1500
1500
JMenuItem firstBoardItem = null ;
1501
- for (JMenu platformMenu : platformMenus ) {
1502
- if (firstBoardItem == null && platformMenu .getItemCount () > 0 )
1503
- firstBoardItem = platformMenu .getItem (0 );
1504
- boardMenu .add (platformMenu );
1501
+ if (platformMenus .size () == 1 ) {
1502
+ // When just one platform exists, add the board items directly,
1503
+ // rather than using a submenu
1504
+ for (Component boardItem : platformMenus .get (0 ).getMenuComponents ()) {
1505
+ boardMenu .add (boardItem );
1506
+ if (firstBoardItem == null )
1507
+ firstBoardItem = (JMenuItem )boardItem ;
1508
+ }
1509
+ } else {
1510
+ // For multiple platforms, use submenus
1511
+ for (JMenu platformMenu : platformMenus ) {
1512
+ if (firstBoardItem == null && platformMenu .getItemCount () > 0 )
1513
+ firstBoardItem = platformMenu .getItem (0 );
1514
+ boardMenu .add (platformMenu );
1515
+ }
1505
1516
}
1506
1517
1507
1518
if (firstBoardItem == null ) {
You can’t perform that action at this time.
0 commit comments