0

Is it possible to create a custom GUI in Java Swing? I’d like my application to be used on multiple operating systems, but I want it to have a custom and I don’t exactly know how to do it. Right now, I’m creating it using JLayeredPane and a bunch of JLabels with icons. It works fine right now, but I’m having trouble making the application resizable(I want it to get bigger so it will be better for larger monitors), and making a progress bar. I know the way I’m doing it is crazy inefficient, but I don’t know what else to do.

I’m also worried that by using so many images will slow down the application and possibly use more resources from the user’s device.

Morteza
  • 642
  • 7
  • 17
  • Can you provide code? It might be best to break your question into two separate questions. Firstly deal with the layout issues here and for the progress bar look [here](https://stackoverflow.com/questions/8916064/how-to-add-a-progress-bar) or create another question if that doesnt work for you. – Paul Rooney Feb 01 '21 at 03:56
  • I don’t have any code issues, I am just asking if my current method is the best way to make a custom ui for my swing application... I am using JLabels with icons on them, and I don’t think that it is the best way to make a custom ui... – KiwiFruit555 Feb 01 '21 at 03:59
  • The whole UI is literally JLabels with empty values, and icons on them. – KiwiFruit555 Feb 01 '21 at 04:00
  • 2
    Swing and JavaFX are both designed for cross platform development. I strongly recommend you start by looking at [Laying Out Components Within a Container](https://docs.oracle.com/javase/tutorial/uiswing/layout/index.html). You may also want to look at [Modifying the Look and Feel](https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/index.html), but personally, I prefer the system look and feel, as it's easier for users to adapt to something they are use to – MadProgrammer Feb 01 '21 at 04:01
  • @MadProgrammer I hope to have an option for themes so users can choose how they like it but I wanted to make my own first because personally, I hate the Windows 10 look... I mainly use Linux for that exact reason. Linux is faster as well... – KiwiFruit555 Feb 01 '21 at 04:19
  • Using a LayeredPane (I'm assuming that you're using one layer per OS?) is not the best way to deal with this. I would make the application work correctly with one give look-and-feel. After the program is done, then I'd worry about making it look great elsewhere. – NomadMaker Feb 01 '21 at 04:39
  • @Amatsuki555 As a general rule - no - I find it easier for "user acceptance" to use the system's look and feel (by system, I mean the look and feel which best matches the system OS), but yes, it's out of date by now – MadProgrammer Feb 01 '21 at 06:20

0 Answers0