I have this part in my program:
private void game()
{
if (tracing) System.out.println("Inside the game method. ");
JFrame frame = new JFrame("Monopoly");
frame.addWindowListener
(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
JPanel mainPanel = new JPanel(new BorderLayout());
JPanel northPanel = new JPanel(new GridLayout(0, 10));
//JLabel myImageLabel = new JLabel(new ImageIcon(“d.jpg”));
if (tracing) System.out.println("Creating the JLabel");
JLabel borginBurkes = new JLabel(new ImageIcon("Borgin and Burkes.png"));
if (tracing) System.out.println("Created the JLabel");
//JLabel pay = new JLabel(new ImageIcon("Camelot's Annual Tax.png"));
//borginBurkes.setBounds(0, 0, 0, 0);
//pay.setBounds(0, 0, 0, 0);
if (tracing) System.out.println("Adding Borgin and Burkes to the northPanel currently.");
northPanel.add(borginBurkes);
//northPanel.add(pay);
if (tracing) System.out.println("Adding the northPanel to the mainPanel. ");
mainPanel.add(northPanel, BorderLayout.NORTH);
frame.setContentPane(mainPanel);
frame.setSize(800, 800);
//frame.setAlwaysOnTop(true);
frame.setVisible(true);
}//end of game method
But it's not working considering the that when I run the program, nothing displays on the screen. Oh. Now it's working. I couldn't put it in the folder "pics" in the program. I had to put them all in the main area.
Although I have to make my screen wider...I mean look at this:
Can't read anything from that! I think I'll make it 500 by 1500 or so. I hope there's enough room! :o
Hmm, looks like there isn't. Well, this sort of sucks! I'm going to have to shorten all the names, it looks like:
OOOKAY. I'll have to go back to all my properties and shorten the names. But it's not possible to shorten something like, I'M GOING ON AN ADVENTURE! ECK! :/ The maximum length for these is 145 or so. Okay..this is going to be hard -_- I have to decrease all the sizes to about 145*275 rather than 275*275.
I found a size that's going to fit, but it's a bit challenging to make them all the same size. These are going to be the official sizes:
- Borgin & Burkes might make a difference rather than Borgin and Burkes. i'll post the other ones later on... :/
No comments:
Post a Comment