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


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

Re: Showing two images in

Started by"Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
First post2011-04-27 15:45 +0000
Last post2011-04-27 15:45 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.java.gui


Contents

  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

#3607 — Re: Showing two images in

From"Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
Date2011-04-27 15:45 +0000
SubjectRe: Showing two images in
Message-ID<g24h4j$p42$1@registered.motzarella.org>
  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

[toc] | [next] | [standalone]


#3608

FromPaul.Lee.1971@gmail.com.remove-dii-this
Date2011-04-27 15:45 +0000
Message-ID<8ec59e7e-18b1-4ded-885c-9d335512e04f@k13g2000hse.googlegroups.com>
In reply to#3607
  To: comp.lang.java.gui
A thousand thanks. I feel like such an idiot. This is stuff I knew 6
years ago!

---
 * 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

[toc] | [prev] | [next] | [standalone]


#3612

From"Lew" <lew@THRWHITE.remove-dii-this>
Date2011-04-27 15:45 +0000
Message-ID<jbSdnS9w6OqPcNjVnZ2dnUVZ_qqdnZ2d@comcast.com>
In reply to#3607
  To: comp.lang.java.gui
Paul.Lee.1971@gmail.com allegedly wrote:
>>         JFrame f = new JFrame();

Daniele Futtorovic wrote:
>         f.getContentPane().add(label, BorderLayout.WEST);
>      f.getContentPane().add(label2, BorderLayout.EAST);

<http://java.sun.com/javase/6/docs/api/javax/swing/JFrame.html>
>> As a conveniance [sic] add and its variants, remove and setLayout 
>> have been overridden to forward to the contentPane as necessary. 
>> This means you can write:
>> 
>>        frame.add(child);

-- 
Lew

---
 * 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web