Skip to content

Commit 83f62c5

Browse files
committed
Top align favorite buttons.
1 parent a03bdea commit 83f62c5

2 files changed

Lines changed: 54 additions & 37 deletions

File tree

src/main/java/me/StevenLawson/BukkitTelnetClient/BTC_MainPanel.form

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
<Group type="102" attributes="0">
219219
<EmptySpace max="-2" attributes="0"/>
220220
<Group type="103" groupAlignment="0" attributes="0">
221-
<Component id="jScrollPane2" pref="293" max="32767" attributes="0"/>
221+
<Component id="tblPlayersScroll" pref="293" max="32767" attributes="0"/>
222222
<Group type="102" alignment="0" attributes="0">
223223
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
224224
<EmptySpace type="unrelated" max="-2" attributes="0"/>
@@ -234,7 +234,7 @@
234234
<Group type="103" groupAlignment="0" attributes="0">
235235
<Group type="102" alignment="0" attributes="0">
236236
<EmptySpace min="-2" max="-2" attributes="0"/>
237-
<Component id="jScrollPane2" pref="369" max="32767" attributes="0"/>
237+
<Component id="tblPlayersScroll" pref="369" max="32767" attributes="0"/>
238238
<EmptySpace type="unrelated" max="-2" attributes="0"/>
239239
<Group type="103" groupAlignment="3" attributes="0">
240240
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -246,7 +246,7 @@
246246
</DimensionLayout>
247247
</Layout>
248248
<SubComponents>
249-
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
249+
<Container class="javax.swing.JScrollPane" name="tblPlayersScroll">
250250
<AuxValues>
251251
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
252252
</AuxValues>
@@ -378,40 +378,51 @@
378378
<DimensionLayout dim="0">
379379
<Group type="103" groupAlignment="0" attributes="0">
380380
<Group type="102" alignment="0" attributes="0">
381-
<EmptySpace max="-2" attributes="0"/>
382-
<Component id="jScrollPane1" pref="293" max="32767" attributes="0"/>
383-
<EmptySpace max="-2" attributes="0"/>
381+
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
382+
<Component id="favoriteButtonsPanelHolder" max="32767" attributes="0"/>
383+
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
384384
</Group>
385385
</Group>
386386
</DimensionLayout>
387387
<DimensionLayout dim="1">
388388
<Group type="103" groupAlignment="0" attributes="0">
389389
<Group type="102" alignment="0" attributes="0">
390390
<EmptySpace max="-2" attributes="0"/>
391-
<Component id="jScrollPane1" pref="400" max="32767" attributes="0"/>
391+
<Component id="favoriteButtonsPanelHolder" max="-2" attributes="0"/>
392392
<EmptySpace max="-2" attributes="0"/>
393393
</Group>
394394
</Group>
395395
</DimensionLayout>
396396
</Layout>
397397
<SubComponents>
398-
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
399-
<Properties>
400-
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
401-
<Border info="null"/>
402-
</Property>
403-
</Properties>
398+
<Container class="javax.swing.JPanel" name="favoriteButtonsPanelHolder">
404399

405-
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
400+
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
406401
<SubComponents>
407-
<Container class="javax.swing.JPanel" name="jPanel5">
408-
<AuxValues>
409-
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BTC_FavoriteButtonsPanel(favButtonList)"/>
410-
</AuxValues>
402+
<Container class="javax.swing.JScrollPane" name="favoriteButtonsPanelScroll">
403+
<Properties>
404+
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
405+
<Border info="null"/>
406+
</Property>
407+
</Properties>
408+
<Constraints>
409+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
410+
<BorderConstraints direction="Center"/>
411+
</Constraint>
412+
</Constraints>
413+
414+
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
415+
<SubComponents>
416+
<Container class="javax.swing.JPanel" name="favoriteButtonsPanel">
417+
<AuxValues>
418+
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BTC_FavoriteButtonsPanel(favButtonList)"/>
419+
</AuxValues>
411420

412-
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
413-
<Property name="useNullLayout" type="boolean" value="true"/>
414-
</Layout>
421+
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
422+
<Property name="useNullLayout" type="boolean" value="true"/>
423+
</Layout>
424+
</Container>
425+
</SubComponents>
415426
</Container>
416427
</SubComponents>
417428
</Container>

src/main/java/me/StevenLawson/BukkitTelnetClient/BTC_MainPanel.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ private void initComponents()
503503
jLabel2 = new javax.swing.JLabel();
504504
jTabbedPane1 = new javax.swing.JTabbedPane();
505505
jPanel2 = new javax.swing.JPanel();
506-
jScrollPane2 = new javax.swing.JScrollPane();
506+
tblPlayersScroll = new javax.swing.JScrollPane();
507507
tblPlayers = new javax.swing.JTable();
508508
jLabel3 = new javax.swing.JLabel();
509509
txtNumPlayers = new javax.swing.JTextField();
@@ -513,8 +513,9 @@ private void initComponents()
513513
chkShowChatOnly = new javax.swing.JCheckBox();
514514
chkIgnoreErrors = new javax.swing.JCheckBox();
515515
jPanel4 = new javax.swing.JPanel();
516-
jScrollPane1 = new javax.swing.JScrollPane();
517-
jPanel5 = new BTC_FavoriteButtonsPanel(favButtonList);
516+
favoriteButtonsPanelHolder = new javax.swing.JPanel();
517+
favoriteButtonsPanelScroll = new javax.swing.JScrollPane();
518+
favoriteButtonsPanel = new BTC_FavoriteButtonsPanel(favButtonList);
518519

519520
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
520521
setTitle("BukkitTelnetClient");
@@ -625,7 +626,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt)
625626

626627
tblPlayers.setAutoCreateRowSorter(true);
627628
tblPlayers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
628-
jScrollPane2.setViewportView(tblPlayers);
629+
tblPlayersScroll.setViewportView(tblPlayers);
629630
tblPlayers.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
630631

631632
jLabel3.setText("# Players:");
@@ -639,7 +640,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt)
639640
.addGroup(jPanel2Layout.createSequentialGroup()
640641
.addContainerGap()
641642
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
642-
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
643+
.addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
643644
.addGroup(jPanel2Layout.createSequentialGroup()
644645
.addComponent(jLabel3)
645646
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@@ -651,7 +652,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt)
651652
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
652653
.addGroup(jPanel2Layout.createSequentialGroup()
653654
.addContainerGap()
654-
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE)
655+
.addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE)
655656
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
656657
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
657658
.addComponent(jLabel3)
@@ -707,25 +708,29 @@ public void actionPerformed(java.awt.event.ActionEvent evt)
707708

708709
jTabbedPane1.addTab("Filters", jPanel1);
709710

710-
jScrollPane1.setBorder(null);
711+
favoriteButtonsPanelHolder.setLayout(new java.awt.BorderLayout());
711712

712-
jPanel5.setLayout(null);
713-
jScrollPane1.setViewportView(jPanel5);
713+
favoriteButtonsPanelScroll.setBorder(null);
714+
715+
favoriteButtonsPanel.setLayout(null);
716+
favoriteButtonsPanelScroll.setViewportView(favoriteButtonsPanel);
717+
718+
favoriteButtonsPanelHolder.add(favoriteButtonsPanelScroll, java.awt.BorderLayout.CENTER);
714719

715720
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
716721
jPanel4.setLayout(jPanel4Layout);
717722
jPanel4Layout.setHorizontalGroup(
718723
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
719724
.addGroup(jPanel4Layout.createSequentialGroup()
720-
.addContainerGap()
721-
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
722-
.addContainerGap())
725+
.addGap(0, 0, 0)
726+
.addComponent(favoriteButtonsPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
727+
.addGap(0, 0, 0))
723728
);
724729
jPanel4Layout.setVerticalGroup(
725730
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
726731
.addGroup(jPanel4Layout.createSequentialGroup()
727732
.addContainerGap()
728-
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
733+
.addComponent(favoriteButtonsPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
729734
.addContainerGap())
730735
);
731736

@@ -810,21 +815,22 @@ private void chkShowChatOnlyActionPerformed(java.awt.event.ActionEvent evt)//GEN
810815
private javax.swing.JCheckBox chkIgnorePlayerCommands;
811816
private javax.swing.JCheckBox chkIgnoreServerCommands;
812817
private javax.swing.JCheckBox chkShowChatOnly;
818+
private javax.swing.JPanel favoriteButtonsPanel;
819+
private javax.swing.JPanel favoriteButtonsPanelHolder;
820+
private javax.swing.JScrollPane favoriteButtonsPanelScroll;
813821
private javax.swing.JLabel jLabel1;
814822
private javax.swing.JLabel jLabel2;
815823
private javax.swing.JLabel jLabel3;
816824
private javax.swing.JPanel jPanel1;
817825
private javax.swing.JPanel jPanel2;
818826
private javax.swing.JPanel jPanel3;
819827
private javax.swing.JPanel jPanel4;
820-
private javax.swing.JPanel jPanel5;
821-
private javax.swing.JScrollPane jScrollPane1;
822-
private javax.swing.JScrollPane jScrollPane2;
823828
private javax.swing.JTabbedPane jTabbedPane1;
824829
private javax.swing.JTextPane mainOutput;
825830
private javax.swing.JScrollPane mainOutputScoll;
826831
private javax.swing.JSplitPane splitPane;
827832
private javax.swing.JTable tblPlayers;
833+
private javax.swing.JScrollPane tblPlayersScroll;
828834
private javax.swing.JTextField txtCommand;
829835
private javax.swing.JTextField txtNumPlayers;
830836
private javax.swing.JComboBox<me.StevenLawson.BukkitTelnetClient.ServerEntry> txtServer;

0 commit comments

Comments
 (0)