# HG changeset patch # User Colin Foster # Date 1392766508 21600 # Node ID 56209bab4213c7fb9005a46a06fe2b116eb8b394 # Parent ebd063b7b1c67aa83d349cd59d5679ecf5bb6684 Update java dialog box to support scrolling (bug #41476). JdialogBox.java: Instantiate a scrollpane and put list inside scrollpane. contributors.in: Add Colin Foster to list of contributors. diff -r ebd063b7b1c6 -r 56209bab4213 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Thu Mar 20 12:28:53 2014 -0400 +++ b/doc/interpreter/contributors.in Tue Feb 18 17:35:08 2014 -0600 @@ -72,6 +72,7 @@ Stephen Fegan Ramon Garcia Fernandez Torsten Finke +Colin Foster Jose Daniel Munoz Frias Brad Froehle Castor Fu diff -r ebd063b7b1c6 -r 56209bab4213 scripts/java/org/octave/JDialogBox.java --- a/scripts/java/org/octave/JDialogBox.java Thu Mar 20 12:28:53 2014 -0400 +++ b/scripts/java/org/octave/JDialogBox.java Tue Feb 18 17:35:08 2014 -0600 @@ -1,5 +1,6 @@ /* +Copyright (C) 2014 Colin Foster Copyright (C) 2010, 2013 Martin Hepperle This file is part of Octave. @@ -551,24 +552,28 @@ { lst[i] = theTranslator.replace (list[i]); } + + JScrollPane scrollPane = new JScrollPane(); m_List = new JList (lst); + scrollPane.setViewportView(m_List); + // replace ugly monospaced font - m_List.setFont (p.getFont ()); + scrollPane.setFont (p.getFont ()); - m_List.setMinimumSize (new Dimension (Math.max (1, - Integer.parseInt (RowsCols[0].toString ())), - Math.max (1, - Integer.parseInt (RowsCols[1].toString ())))); - m_List.setPreferredSize (new Dimension (Math.max (1, - Integer.parseInt (RowsCols[1].toString ())), - Math.max (1, - Integer.parseInt (RowsCols[0].toString ())))); - m_List.setBorder (new javax.swing.border.EtchedBorder ()); + scrollPane.setMinimumSize ( + new Dimension ( + Math.max (1, Integer.parseInt (RowsCols[0].toString ())), + Math.max (1, Integer.parseInt (RowsCols[1].toString ())))); + scrollPane.setPreferredSize ( + new Dimension ( + Math.max (1, Integer.parseInt (RowsCols[1].toString ())), + Math.max (1, Integer.parseInt (RowsCols[0].toString ())))); + scrollPane.setBorder (new javax.swing.border.EtchedBorder ()); gbc.gridy = message.length; gbc.fill = GridBagConstraints.HORIZONTAL; - p.add (m_List, gbc); + p.add (scrollPane, gbc); if (on.toLowerCase ().equals ("single")) {