Vishal Vishal - 5 months ago 8x
Java Question

Develop an application in java For different screen resolutions

I am a c# developer. Now, I want to learn java and want to create a desktop application in Java.

The application that I want to create using Java is a line of business application. In simple terms, the application will have some textboxes, labels, comboboxes & datagrid and it will mainly be CRUD operations.

Now, I would like to know that what tools should I use to fulfill my below mentioned requirements:

  1. Which is the latest tool to develop java applications? In c# we used Visual Studio

  2. What should I use? I mean Swing or Java FX or might be something else? Because once I complete my project it will be installed on different computers with different sized screens and different screen resolutions. In .Net we used WPF. In WPF we have some layout containers like Grid & Wrap Panel etc... So by using those containers properly we can have a good application that looks almost similar in any screen resolution and on any sized screen.

  1. You can use either Eclipse or IntelliJ, both are great
  2. JavaFX definitely! It gives you more options, and its very html & CSS friendly (yes, you can use this for desktop apps), great for on-the-fly image scaling, so different resolution will be easily handled with it. If you combine it with bootstrap, you'll have an easy job

For example:

Button buttonColor = new Button("Color");
buttonColor.setStyle("-fx-background-color: slateblue; -fx-text-fill: white;");

You get this:

Of course, you can place this in css file and then use it:

#font-button {
    -fx-font: bold italic 20pt "Arial";
    -fx-effect: dropshadow( one-pass-box , black , 8 , 0.0 , 2 , 0 );

and then:

Button buttonFont = new Button("Font");

results in: