Ok I've found a lot on how to get the resolution of the current monitor, but I want to change it. So that way every time my game is ran, it is always ran in the same resolution. How can I go about doing this ?
* Ok so I've moved on from trying to force a certain resolution, and gone more towards drawing things based on width and height variables.
But that isn't working out so well,
for instance, I'm trying to get this item icon to display in the inventory.
g.drawImage(broadsword, width - (width / 8 -2), height / 2 - 9, null);
now when I run the game in my native res of 1920x1080 it fits in the slot perfectly. But if I change to sat 1280x720, it is drawn too far to the right.
Figured it out, instead of having it display the entire user interface based on the resolution of the user, I have it create a baseline x and y variable based on the 0, 0 location of where it starts to draw the inventory.
g.drawImage(inventory, width - 499, height / 2 - 20, null);
int ixt = width - 499;
int iyt = height / 2 - 20;
g.drawImage(broadsword, ixt + 10, iyt + 10, null);
Seems to scale perfect for any resolution.