Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3607

Re: Showing two images in

From "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
Subject Re: Showing two images in
Message-ID <g24h4j$p42$1@registered.motzarella.org> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:45 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On 2008-06-04 00:28 +0100, Paul.Lee.1971@gmail.com allegedly wrote:
> Hi,
> Could some kind soul please look at this code and see whats wrong. Its
> probably something similar, but I can't see it. I'm trying to display
> two bufferedimages in a JFrame;
> 
>         JLabel label = new JLabel(new ImageIcon(image));
> 	JLabel label2 = new JLabel(new ImageIcon(bimage));
>         JFrame f = new JFrame();
>         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>         f.getContentPane().add(label);
> 	f.getContentPane().add(label2);
>         f.pack();
>         f.setLocation(200,200);
> 	f.setSize(1000,1000);
>         f.setVisible(true);
> 
> At present, it just displays bimage (presumably on top of image)
> 
> Thanks
> 
> Paul
> 

         f.getContentPane().add(label, BorderLayout.WEST);
  	f.getContentPane().add(label2, BorderLayout.EAST);

Learn about layouts:
<http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html>

-- 
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Showing two images in "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
  Re: Showing two images in Paul.Lee.1971@gmail.com.remove-dii-this - 2011-04-27 15:45 +0000
  Re: Showing two images in "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000

csiph-web