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 @@ -1511,10 +1511,21 @@ public void actionPerformed(ActionEvent actionevent) {
1511
1511
}
1512
1512
1513
1513
JMenuItem firstBoardItem = null ;
1514
- for (JMenu platformMenu : platformMenus ) {
1515
- if (firstBoardItem == null && platformMenu .getItemCount () > 0 )
1516
- firstBoardItem = platformMenu .getItem (0 );
1517
- boardMenu .add (platformMenu );
1514
+ if (platformMenus .size () == 1 ) {
1515
+ // When just one platform exists, add the board items directly,
1516
+ // rather than using a submenu
1517
+ for (Component boardItem : platformMenus .get (0 ).getMenuComponents ()) {
1518
+ boardMenu .add (boardItem );
1519
+ if (firstBoardItem == null )
1520
+ firstBoardItem = (JMenuItem )boardItem ;
1521
+ }
1522
+ } else {
1523
+ // For multiple platforms, use submenus
1524
+ for (JMenu platformMenu : platformMenus ) {
1525
+ if (firstBoardItem == null && platformMenu .getItemCount () > 0 )
1526
+ firstBoardItem = platformMenu .getItem (0 );
1527
+ boardMenu .add (platformMenu );
1528
+ }
1518
1529
}
1519
1530
1520
1531
if (firstBoardItem == null ) {
You can’t perform that action at this time.
0 commit comments