This is my code:
public class Test extends JFrame {
static BufferedImage s;
public static void main(String[] args) throws IOException {
Test t = new Test();
s = ImageIO.read(new File("test.png"));
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setSize(600, 600);
t.setVisible(true);
}
@Override
public void paint(Graphics g) {
super.paint(g);
g.drawImage(s, 0, 0, 32, 32, this);
}}
Basically if I draw my image at those coordinates it'll draw part of my image under the JFrame border (both the left border and the top border that has the JFrame title) so the only way to get around it would be by calculating the size of both borders.
Is the only way to draw my image next to both borders to calculate their sizes? If yes then what if I decide to run this code on Linux, doesn't it have different sizes for its borders?