0

I'm creating a java application.there I want to keep jframe in maximized state.and I want to use it many of monitors that have different screen size.and I want to components in jframe to resize with jframe.also I need to add image to the background of the frame.that image also should resize with the jframe. how to do that?

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
Ruwan
  • 41
  • 4

1 Answers1

1

Layout managers, layout managers, layout managers

Start by taking a look at

You might also want to have a look at Full-Screen Exclusive Mode API, depending on what you're hoping to achieve

also I need to add image to the background of the frame.that image also should resize with the jframe. how to do that?

I see lots of searching and research in your future.

Community
  • 1
  • 1
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • Using Layout managers I can do some features.but I couldn't add image to the background. because, I had to set layout to null for add jlabel to the main panel. – Ruwan Apr 19 '17 at 04:51
  • *"because, I had to set layout to null for add jlabel to the main panel"* - Then you're doing it wrong - And I wouldn't use a `JLabel` for displaying a background image, one of the links above explains why. If you don't want to use a layout manager, then you'll be re-inventing the wheel making your own, which will never work as well as those that are designed to work with the overall Swing API – MadProgrammer Apr 19 '17 at 04:52
  • yes,You are correct.but the matter is I'm fresher to java and I don't have much time to do this. So. I'm very complicated with this.However,I will have to find this.Thank you very much for your help friend. – Ruwan Apr 19 '17 at 05:08