I am creating a wrapper for Notch's "Prelude of the Chambered", and I wish to make it so that you can resize the window. I can not figure out how I could make the contents scale, I have tried to override onPaint. I can not modify the Jar to get this done.
onPaint attempt:
package com.gudenau.pc.poc;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
public class JScaledFrame extends JFrame {
private static final long serialVersionUID = 4044340683411982494L;
public JScaledFrame(String title) {
super(title);
}
@Override
public void paint(Graphics graphics){
Dimension min = getMinimumSize();
Dimension size = getSize();
BufferedImage image = new BufferedImage(min.width, min.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics subGraphics = image.getGraphics();
super.paint(subGraphics);
subGraphics.dispose();
graphics.drawImage(image, 0, 0, size.width, size.height, null);
}
}