Hi folks,
Just wondering if the following is considered to be good programming practice or not? I like to keep my individual source files as concise and uncluttered as possible, but I'm wondering what more experienced coders would think of it. I especially like the idea of the Settings.java class to keep all of my "Magic Numbers" in the one place. Has anyone any suggestions as to how I might improve on things?
Thanks for your help.
Happy coding :-)
class ApplicationLauncher
{
public static void main(String[] args)
{
SwingApplication mySwingApplication = new SwingApplication();
}
}
//////////////
import javax.swing.*;
public class SwingApplication extends JFrame
{
public SwingApplication()
{
JFrame myJFrame = new JFrame();
myJFrame.setSize(Settings.frameWidth, Settings.frameHeight);
myJFrame.setVisible(true);
}
}
//////////////
class Settings
{
static int frameWidth = 100;
static int frameHeight = 200;
}