Newsgroup: it.comp.java
Titolo: AIUUUUTO

Quando schiaccio il pulsante uno  lo stream parte correttamente e si
apre il pannello del player...
perň il pulsante uno si blocca e no posso schiacciare piů nenche il
due...
quale č la soluzione????
usare i thread??
vi posto il codice dateci un occhiata 
Ciaooo
import javax.swing.*;          
import java.awt.*;
import java.awt.event.*;
public class SwingApplication implements ActionListener {
 
	private JButton uno;
	private JButton due;
	private JButton tre;
 
 
	ReceiveVideo1 receiveVideo1= new ReceiveVideo1();
	ReceiveAudio receiveAudio= new ReceiveAudio();
	ReceiveVideo2 receiveVideo2= new ReceiveVideo2();
 
 
 
 
	String title="Sistema di videconf";
	String title1=" *******";
	String vuota="";
	final JLabel label = new JLabel(title);
	final JLabel label1 = new JLabel(title1);
	final JLabel labelvuoto = new JLabel(vuota);
	final static String LOOKANDFEEL = null;
	public Component createComponents() {
		 uno = new JButton("Cam 1");
		 due = new JButton("audio");
		 tre = new JButton("cam2");
 
 
		uno.setMnemonic(KeyEvent.VK_I);
		uno.addActionListener(this);
		label.setLabelFor(uno);
 
		due.setMnemonic(KeyEvent.VK_I);
		due.addActionListener(this);
		label.setLabelFor(due);
 
		tre.setMnemonic(KeyEvent.VK_I);
		tre.addActionListener(this);
		label.setLabelFor(tre);
 
		JPanel pane = new JPanel(new GridLayout(4, 2));
	         pane.setBorder(BorderFactory.createEmptyBorder(30, //top
							        30, //left
							        30, //bottom
								30) //right
								 );
		pane.add(label);
		pane.add(label1);
		pane.add(uno);
		pane.add(due);
		pane.add(tre);
		return pane;
	}
	public void actionPerformed(ActionEvent e) {
		if(e.getSource()== uno){
 
			receiveVideo1.lancioReceiveVideo1();
 
 
		}
		if(e.getSource()== 2){
			receiveVideo2.lancioReceiveVideo2();
                        receiveAudio.lancioReceiveAudio();
		}
 
	}
	private static void initLookAndFeel() {
		String lookAndFeel = null;
		if (LOOKANDFEEL != null) {
			if (LOOKANDFEEL.equals("Metal")) {
				lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
			} else if (LOOKANDFEEL.equals("System")) {
				lookAndFeel = UIManager.getSystemLookAndFeelClassName();
			} else if (LOOKANDFEEL.equals("Motif")) {
				lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
			} else if (LOOKANDFEEL.equals("GTK+")) { //new in 1.4.2
				lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
			} else {
				System.err.println("Unexpected value of LOOKANDFEEL specified: "
								   + LOOKANDFEEL);
				lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
			}
			try {
				UIManager.setLookAndFeel(lookAndFeel);
			} catch (ClassNotFoundException e) {
				System.err.println("Couldn't find class for specified look and
feel:"
								   + lookAndFeel);
				System.err.println("Did you include the L&F library in the class
path?");
				System.err.println("Using the default look and feel.");
			} catch (UnsupportedLookAndFeelException e) {
				System.err.println("Can't use the specified look and feel ("
								   + lookAndFeel
								   + ") on this platform.");
				System.err.println("Using the default look and feel.");
			} catch (Exception e) {
				System.err.println("Couldn't get specified look and feel ("
								   + lookAndFeel
								   + "), for some reason.");
				System.err.println("Using the default look and feel.");
				e.printStackTrace();
			}
		}
	}
	/**
	 * Create the GUI and show it.  For thread safety,
	 * this method should be invoked from the
	 * event-dispatching thread.
	 */
	private static void createAndShowGUI() {
		//Set the look and feel.
		initLookAndFeel();
		//Make sure we have nice window decorations.
		JFrame.setDefaultLookAndFeelDecorated(true);
		//Create and set up the window.
		JFrame frame = new JFrame(" web___cam");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
		SwingApplication app = new SwingApplication();
		Component contents = app.createComponents();
		frame.getContentPane().add(contents, BorderLayout.CENTER);
		//Display the window.
		frame.setResizable(false);
		frame.setLocation(0,812);
		frame.pack();
		frame.setVisible(true);
	}
	public static void main(String[] args) {
		//Schedule a job for the event-dispatching thread:
		//creating and showing this application's GUI.
		javax.swing.SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				createAndShowGUI();
			}
		});
	}
}

 usare i thread??
Sě.
Ciao.
-- 
questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news
 segnala gli abusi ad 
ab...@newsland.it