Hi Thanks for taking the time. I am not sure I follow.
- This does not work even if I use q windows computer. - I need the software to do the redirection to an external monitor. The users are not savvy enough to do that. Is that doable?. I can find lot of sample code. Which suggests it must be possible. I may be doing something wrong. Regards Murali > On 12 Jan 2023, at 11:32 PM, Ernie Rael <err...@raelity.com> wrote: > > Looks like the issue is between the MacBook and JDK. (No NetBeans APIs > involved). If you can move MAC windows to the external monitor, then you need > JDK support. > > -ernie > > On 23/01/12 12:13 AM, Murali Govind wrote: >> Hi >> >> Any one can help with the below problem? >> >> Regards >> Murali >> >>> On 6 Jan 2023, at 11:30 AM, Murali Govind <murali...@gmail.com >>> <mailto:murali...@gmail.com>> wrote: >>> >>> Hi >>> >>> I have a Laptop- MacBook Air.. And I have a TV connected to it via USB C -> >>> HDMI . I have tried everything in the code snippets I could find in google. >>> >>> public static void disponscreen() { >>> System.out.println("Hello from the Disp on screen Function!"); >>> >>> >>> Integer j=0; >>> GraphicsEnvironment ge = GraphicsEnvironment. >>> getLocalGraphicsEnvironment(); >>> GraphicsDevice[] gs = ge.getScreenDevices(); >>> System.out.println("No of monitord"+ge.getDefaultScreenDevice()); >>> >>> System.out.println("No of monitord"+gs.length); >>> GraphicsDevice gd = gs[0]; >>> GraphicsConfiguration[] gc = gd.getConfigurations(); >>> >>> JFrame f = new JFrame("simple gui"); >>> >>> f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); >>> JLabel textLabel = new JLabel("I'm a label in the window"); >>> textLabel.setPreferredSize(new Dimension(300, 100)); >>> f.getContentPane().add(textLabel, BorderLayout.CENTER); >>> //Display the window. >>> frame.setLocationRelativeTo(null); frame.pack(); >>> frame.setVisible(true); } public static void main(String[] args) { >>> createWindow(); } } >>> f.setVisible(true); >>> >>> } >>> public static void main(String[] args) { >>> System.out.println("Hello from the Java Main Function!"); >>> disponscreen(); >>> >>> } >>> >>> gs.length is 1 regardless of connecting or not connecting a TV >>> >>> >>> >>> gs.length is 1 regardless of connecting or not connecting a TV >>> >>> I expect to have gs.length = 2. Ie two devices connected. >>> >>> Anyone can help?? >>> >>> Regards >>> Murali >>> >>> >> >