java - Transparent window changes look -


I am trying to create a transparent window with a viewfinder toolbar, and so far I was able to do this besides I'm looking for a change in window from the normal OS look and looks at the default metal look. I was just thinking that there is a way around it. This is my code:

  import java.awt. *; Import javax.swing.JFrame; Import javax.swing.JPanel; Public category NewClass2 enhances JFrame {public NewClass2 () {`Enter code here 'super (" New 2 "); // setBackground (new color (0,0,0,0,0,0)); // This window sets a transparent set (new dimension (300,200)); SetLocationRelativeTo (zero); setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); SetVisible (true); } Public Static Zero Main (String [] Args) {//JFrame.setDefaultLookAndFeelDecorated (true) .this one prevents exceptions / occurring from transparent windows, but changes appear and feel NewClass2 cls2 = New NewClass2 ( ); }}    

You never set and do not think you want to use So, Java default is ever "thinks" what ever it looks and feels ... which is usually metal.

Add ...

  try {UIManager.setLookAndFeel (Uimanager .getSystemLookAndFeelClassName ()); } Catch (ClasNotFound Expression | Instantation Apoccection | Invalid Invalid Access | Unsupported Lock and Eiffel Expectation Ex) {ex.printStackTrace (); }   

Before you create any UI elements.

Take a look for a few more details

You should also make sure that your UI

is ensured If you do not hit any potential paint problems or other threading problems, the event has started with reference to the Dispatching Thread

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -