Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd Background Image under JTable & JButton
    primarykey
    data
    text
    <p>I have literally tried every single tutorial, example and looked at every post in order to add a background image to my class. However, the image is just being placed above the JTable &amp; JButton!</p> <p>Would really appreciate some guidance, again i have tried nearly everylink on stackoverflow in order to solve this issue.</p> <p>This is the code to my class:</p> <pre><code>package game; public final class HighScores { private JFrame frame; public HighScores() throws FileNotFoundException, IOException{ frame = new JFrame(); frame.setTitle("The Birds Game - High Scores"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel Lbl = new JLabel("The Birds Game", JLabel.CENTER); frame.add(Lbl,BorderLayout.NORTH); JButton mainMenu = new JButton("Main Menu"); mainMenu.setFocusable(false); frame.add(mainMenu, BorderLayout.SOUTH); mainMenu.setBackground(Color.lightGray); mainMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mainMenuButtonActionPerformed(evt); } }); frame.setSize(600, 500); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setVisible(true); } /** mainMenu button action*/ private void mainMenuButtonActionPerformed(java.awt.event.ActionEvent evt) { frame.dispose(); new Main().setVisible(true); } } </code></pre> <p>Another Issue i am having the Jtable is taking up all the space in the Frame i want it centered, however to do that i need to add it to a panel but if i add it to a panel and not frame the panel multiplies three times!</p> <p>Thank you for your support!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload