Ok so I have been working on this for a moment now and wondering how to add multiple jlabels to a jframe. the code looks like this:
[code=java]
JLabel jl = new JLabel("DVD ID #= " + dvd[0][0]); //Displays DVD id
JLabel j2 = new JLabel("Name of DVD = " + dvd[0][1]); //Displays dvd name
JFrame frame = new JFrame( "Matt's DVD's" ); // Sets frame for label
frame.setDefaul tCloseOperation ( JFrame.EXIT_ON_ CLOSE );
frame.getConten tPane().add(jl) ;
frame.setSize( 420, 170 ); // set frame size
frame.setVisibl e( true ); // display frame
[/code]
I got it to display one of them, but it will not display a second one. What do I need to add to make it work? Any help would be awesome
[code=java]
JLabel jl = new JLabel("DVD ID #= " + dvd[0][0]); //Displays DVD id
JLabel j2 = new JLabel("Name of DVD = " + dvd[0][1]); //Displays dvd name
JFrame frame = new JFrame( "Matt's DVD's" ); // Sets frame for label
frame.setDefaul tCloseOperation ( JFrame.EXIT_ON_ CLOSE );
frame.getConten tPane().add(jl) ;
frame.setSize( 420, 170 ); // set frame size
frame.setVisibl e( true ); // display frame
[/code]
I got it to display one of them, but it will not display a second one. What do I need to add to make it work? Any help would be awesome
Comment