pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1859941 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
Date Sat, 25 May 2019 10:28:12 GMT
Author: tilman
Date: Sat May 25 10:28:12 2019
New Revision: 1859941

URL: http://svn.apache.org/viewvc?rev=1859941&view=rev
Log:
PDFBOX-2941: create window sizes relative to screen size, regardless of jdk version and screen
resolution (HiDPI or not)

Modified:
    pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java?rev=1859941&r1=1859940&r2=1859941&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java (original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java Sat May
25 10:28:12 2019
@@ -357,9 +357,11 @@ public class PDFDebugger extends JFrame
                 exitForm(evt);
             }
         });
-        
+
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
         jScrollPane1.setBorder(new BevelBorder(BevelBorder.RAISED));
-        jScrollPane1.setPreferredSize(new Dimension(350, 500));
+        jScrollPane1.setPreferredSize(new Dimension(screenSize.width / 8, 500));
+        jSplitPane1.setDividerLocation(screenSize.width / 8);
         tree.addTreeSelectionListener(new TreeSelectionListener()
         {
             @Override
@@ -373,8 +375,8 @@ public class PDFDebugger extends JFrame
 
         jSplitPane1.setRightComponent(jScrollPane2);
         jSplitPane1.setDividerSize(3);
-        
-        jScrollPane2.setPreferredSize(new Dimension(300, 500));
+
+        jScrollPane2.setPreferredSize(new Dimension(screenSize.width / 8 * 7, 500));
         jScrollPane2.setViewportView(jTextPane1);
 
         jSplitPane1.setLeftComponent(jScrollPane1);
@@ -401,10 +403,7 @@ public class PDFDebugger extends JFrame
         menuBar.add(viewMenu.getMenu());
         setJMenuBar(menuBar);
 
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        int width = 1000;
-        int height = 970;
-        setBounds((screenSize.width - width) / 2, (screenSize.height - height) / 2, width,
height);
+        setBounds(screenSize.width / 4, screenSize.height / 4, screenSize.width / 2, screenSize.height
/ 2);
 
         // drag and drop to open files
         setTransferHandler(new TransferHandler()



Mime
View raw message