0

I recently purchased a Surface Pro for personal use and the resolution is 2736 x 1824. I decided to start a mini project for a friend designing a note taking app. I'm mainly doing this for more experience and practice on my own so any help would be appreciated!

I created a new GUI with java swing while working on the Surface Pro and began adding needed elements, though when I packaged everything into a JAR file and ran to get a look the elements were very tiny. I haven't worked on anything else yet as I'd like to get the display right before continuing with the rest!

This is my code currently:

import javax.swing.*;

public class FoxAid extends JFrame {

    private JButton btnFile;
    private JPanel mainPanel;
    private JToolBar toolBar;
    private JTextArea txtEditor;
    private JButton btnEdit;
    private JButton btnFormat;
    private JButton btnView;
    private JButton btnHelp;

    public FoxAid(String title) {
        super(title);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setContentPane(mainPanel);
        this.pack();
    }

    public static void main(String[] args) {
        FoxAid foxAid = new FoxAid("Fox Aid");

        foxAid.setVisible(true);
    }

}

I haven't gone any further since my main focus is fixing the size! I'll post an image of what I mean here as well! Thank you so much for your time!

Image of note taking app being very tiny:

Image of note taking app being very tiny

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
Gio
  • 1
  • https://stackoverflow.com/questions/15659044/how-to-set-the-dpi-of-java-swing-apps-on-windows-linux might help – seenukarthi Sep 14 '21 at 08:54
  • [Maybe](https://news.kynosarges.org/2019/03/24/swing-high-dpi-properties/) or [maybe](https://github.com/krlvm/SwingDPI) or something along the lines – MadProgrammer Sep 14 '21 at 09:14

0 Answers0