Iam using an AWT component. Did a little research but cannot find anyway I can make my player return a JComponent..tried this casting but Iam getting an exception at the line.
((com = (JComponent)p.getVisualComponent()) != null)
I also got to see something about mixing SWING with AWT so I decided to take out AWT completely but i seem to get errors with FlowLayout, and ActionListener..PS Iam using swing panels and frames and only used the AWT for the component and listeners..
This is what I tried with the image part
imageLabel=new JLabel(new ImageIcon("optic.jpg")); imageLabel.setHorizontalAlignment(JLabel.CENTER); mainPanel.setEnabled(false); mainPanel.setOpaque(false); otherPanel.setBackground(Color.black); otherPanel.add(imageLabel,BorderLayout.CENTER);
when a button A is clicked the mainPanel is supposed to display the webcam image, which works well. when button B is pressed, this image displays but not correctly. after a resize of the window, it then displays as needed on the frame. however, when button A is pressed again, the frame does not display anymore..hope this helps abit