4242import java .awt .event .KeyAdapter ;
4343import java .awt .event .KeyEvent ;
4444import java .net .URL ;
45+ import java .time .Instant ;
46+ import java .time .LocalDateTime ;
47+ import java .time .ZoneId ;
48+ import java .time .ZoneOffset ;
49+ import java .time .format .DateTimeFormatter ;
4550import java .util .ArrayList ;
4651import java .util .Collections ;
4752import java .util .Comparator ;
@@ -349,11 +354,17 @@ public SwingSearchPanel() {
349354 final JPanel detailsPane = new JPanel ();
350355 final JLabel detailsTitle = new JLabel ();
351356 final JPanel detailsProps = new JPanel ();
357+ final JScrollPane detailsScrollPane = new JScrollPane (detailsProps );
352358 final JPanel detailsButtons = new JPanel ();
353359
354- detailsProps .setLayout (new MigLayout ("fill, wrap 1, ins 0, wmin 10" ));
355- detailsButtons .setLayout (new MigLayout ("fill, ins " + PAD + " 0 " + PAD + " 0" ));
356- detailsPane .setLayout (new MigLayout ("wrap, ins 0 " + PAD + " " + PAD + " " + PAD + ", fill, wmin 100, hmin 100" ,"[grow]" , "[fill][fill]push[fill]" ));
360+ detailsScrollPane .setHorizontalScrollBarPolicy (
361+ ScrollPaneConstants .HORIZONTAL_SCROLLBAR_NEVER );
362+ detailsScrollPane .setBorder (null );
363+
364+ detailsProps .setLayout (new MigLayout ("wrap 1, ins 0, wmin 0, hmin 0" , "[grow]" , "" ));
365+ detailsButtons .setLayout (new MigLayout ("fill, ins " + PAD + " 0 0 0" ));
366+ detailsPane .setLayout (new MigLayout ("wrap, ins 0 " + PAD + " " + PAD + " " + PAD + ", fill, wmin 0, hmin 0, hmax 100%, wmax 100%" ,
367+ "[grow]" , "[fill][fill,grow][fill]" ));
357368
358369 resultsList .addListSelectionListener (lse -> {
359370 if (lse .getValueIsAdjusting ()) return ;
@@ -373,7 +384,6 @@ public SwingSearchPanel() {
373384 else {
374385 // populate details pane
375386 detailsTitle .setText ("<html><h2>" + highlightSearchUnderline (escapeHtml (result .name ()), searchTerm ) + "</h2>" );
376- detailsTitle .repaint ();
377387 detailsProps .removeAll ();
378388 result .properties ().forEach ((k , v ) -> {
379389 if (v != "" ) {
@@ -422,10 +432,7 @@ public SwingSearchPanel() {
422432 });
423433 button .addKeyListener (new SearchBarKeyAdapter ());
424434 if (first ){
425- JPanel mainBtnPane = new JPanel ();
426- mainBtnPane .setLayout (new MigLayout ("insets 0" , "[fill,grow]" , "[fill,grow]" ));
427- mainBtnPane .add (button , "growx" );
428- detailsButtons .add (mainBtnPane , "south" );
435+ detailsButtons .add (button , "grow, spanx" );
429436 JRootPane rootPane = this .getRootPane ();
430437 if (rootPane != null ){
431438 rootPane .setDefaultButton (button );
@@ -440,7 +447,7 @@ public SwingSearchPanel() {
440447
441448 detailsPane .add (exitBtn , "pos n 0 100% n" );
442449 detailsPane .add (detailsTitle ,"growx, pad 0 0 0 -20" );
443- detailsPane .add (detailsProps , "growx" );
450+ detailsPane .add (detailsScrollPane , "growx, hmin 0, wmin 0 " );
444451 detailsPane .add (detailsButtons , "growx" );
445452
446453 resultsList .addKeyListener (new SearchBarKeyAdapter ());
@@ -460,7 +467,7 @@ public SwingSearchPanel() {
460467 public void search (final String text ) {
461468 assertDispatchThread ();
462469 searchTerm = text ;
463- operation .search (text );
470+ operation .search (text . toLowerCase () );
464471 }
465472
466473 // -- Helper methods --
@@ -655,6 +662,7 @@ public String escapeHtml(String s) {
655662 }
656663 return out .toString ();
657664 }
665+
658666 }
659667
660668 private class SearchBarKeyAdapter extends KeyAdapter {
0 commit comments