I just finished the java swing course and I am trying to make a login page with java and java swing. I designed a login page with Figma but I couldn't convert it to the java swing code so I decided to code something similar to the design in Figma with java Swing. I set 'LoginNameText' 's color to RGB(30,30,30) with 59% opacity in Figma but I can not do it in java Swing. I asked ChatGPT for it and it gave me this code but it did not work either. How can I solve it ?
int alpha=(int) 0.59*255;
JLabel LoginNameText=new JLabel();
LoginNameText.setBounds(0,170,500,100);
LoginNameText.setText("Name");
LoginNameText.setFont(new Font("Arials",Font.BOLD,30));
LoginNameText.setHorizontalAlignment(JLabel.CENTER);
LoginNameText.setForeground(new Color(30,30,30,alpha));