Java Swing layouts

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 52

  • @DaveJaynes
    @DaveJaynes ปีที่แล้ว +9

    Your ease of speaking through difficult topics and common sense approach of explaining Swing is absolutely fantastic. Thank you Dave, I have learned more of your tutorial than anywhere else.

    • @javadave
      @javadave  ปีที่แล้ว

      Thanks Dave, very kind of you to say.

  • @Miketar2424
    @Miketar2424 11 หลายเดือนก่อน +1

    Thankyou for this excellent series. I can't say enough about the quality and clarity of the explanations.

    • @javadave
      @javadave  11 หลายเดือนก่อน

      Thanks. It's nice to hear it's appreciated.

  • @mukynas
    @mukynas 11 หลายเดือนก่อน +1

    I lost my sanity looking for a decent layout manager only to discover I could use the absolute layout all along! Thanks

    • @javadave
      @javadave  11 หลายเดือนก่อน

      Haha, yes, there was a time for me too when I didn't know about absolute layout. I've been through this as well.

  • @manjilsapkota193
    @manjilsapkota193 ปีที่แล้ว +1

    Thank you found your video after being lost at web for about 3 days nice video thank you

    • @javadave
      @javadave  ปีที่แล้ว

      Thanks! Glad to hear it.

  • @davenfroberg5585
    @davenfroberg5585 2 ปีที่แล้ว +1

    Thank you so much for this video! I'm doing a project in my uni comp sci class and the professors expect us to learn this all ourselves, so this video really helped!!

    • @javadave
      @javadave  2 ปีที่แล้ว +1

      Thanks Daven. If you have any suggestions about other topics that would be useful, do let me know. People like you are target audience.

  • @aidrecabrera3565
    @aidrecabrera3565 ปีที่แล้ว +2

    You're a life saver. Thank you for this very informative video!

    • @javadave
      @javadave  ปีที่แล้ว

      Thanks for saying so :)

  • @wilastakurniawan7206
    @wilastakurniawan7206 2 ปีที่แล้ว +2

    in case someone hesitate what kind of layout they should use based on Oracle site instruction:
    "If you are not interested in learning all the details of layout management, you might prefer to use the GroupLayout layout manager combined with a builder tool to lay out your GUI. One such builder tool is the NetBeans IDE. Otherwise, if you want to code by hand and do not want to use GroupLayout, then GridBagLayout is recommended as the next most flexible and powerful layout manager."

    • @javadave
      @javadave  2 ปีที่แล้ว

      That's a great tip Wilasta. UI editors can save time but I think its good to know what's going on under the hood. GridBagLayout can be a bit painful.

  • @MohamedAitLhaj-y3l
    @MohamedAitLhaj-y3l 6 หลายเดือนก่อน

    Thank you for this amazing playlist.

  • @decals4guitar828
    @decals4guitar828 2 ปีที่แล้ว

    This is the best swing tutorial series! Already subbed. Thank you so much for your content!

    • @javadave
      @javadave  2 ปีที่แล้ว

      Thanks. :)

  • @masterofkaarsvet
    @masterofkaarsvet 3 ปีที่แล้ว +2

    This was an excellent tutorial, thank you so much!

    • @javadave
      @javadave  3 ปีที่แล้ว +1

      You're very welcome!

  • @furkankanarya2370
    @furkankanarya2370 3 ปีที่แล้ว

    That was very helpful, i'll definitely watch the other videos!

    • @javadave
      @javadave  3 ปีที่แล้ว +2

      Thankyou. I hope you find some other useful info. If you have any suggestions, let me know.

  • @kobeblackburn4084
    @kobeblackburn4084 5 หลายเดือนก่อน +1

    Thanks Dave! Great video

    • @javadave
      @javadave  5 หลายเดือนก่อน

      Thanks for saying so Kobe.

  • @CrispyOnionChannel
    @CrispyOnionChannel 7 หลายเดือนก่อน +1

    This guy doesn't blink

    • @javadave
      @javadave  7 หลายเดือนก่อน

      I'm AI generated.

  • @lunyjockkai7388
    @lunyjockkai7388 ปีที่แล้ว +1

    Yes, it great topic indeed

    • @javadave
      @javadave  ปีที่แล้ว

      I agree. I find user interface work to be quite creative and fun. Thanks for watching.

  • @leviplays7466
    @leviplays7466 2 หลายเดือนก่อน +1

    thank you

    • @javadave
      @javadave  2 หลายเดือนก่อน

      You're welcome

  • @GioAlco
    @GioAlco 9 หลายเดือนก่อน +1

    Thank you! 😁

    • @javadave
      @javadave  9 หลายเดือนก่อน

      You're welcome!

  • @ellisrichards3381
    @ellisrichards3381 7 หลายเดือนก่อน +1

    Thank you sir

    • @javadave
      @javadave  7 หลายเดือนก่อน

      You're welcome. Hope it was useful.

  • @bangprob
    @bangprob 2 หลายเดือนก่อน +1

    Thanks!

    • @javadave
      @javadave  2 หลายเดือนก่อน

      You're welcome

  • @agustinsimiand400
    @agustinsimiand400 10 หลายเดือนก่อน +1

    love u man thanks

    • @javadave
      @javadave  10 หลายเดือนก่อน

      Thanks a lot. I hope it was helpful.

  • @mfrazeehvacc5012
    @mfrazeehvacc5012 2 ปีที่แล้ว

    thank you so much! I just subscribed!

    • @javadave
      @javadave  2 ปีที่แล้ว

      Thanks for the sub!

  • @chavezRestricted
    @chavezRestricted 3 ปีที่แล้ว

    Great code and explanation. Can you put the link of project?

    • @javadave
      @javadave  3 ปีที่แล้ว

      I didn't save it. Sorry about that.

    • @chavezRestricted
      @chavezRestricted 3 ปีที่แล้ว

      depends of version windows builder can show the interface, but maybe with this change can be run
      JComboBox combo = new JComboBox(new String[] {"Item 1", "Item 2", "Item 3"});

  • @pjguitar15
    @pjguitar15 3 ปีที่แล้ว

    I learned a lot from you. But i got a question. I have a project that uses drag and drop swing and I want to modify something but it seems that the components cannot be modified for some reason.. How do I do it using code?

    • @javadave
      @javadave  3 ปีที่แล้ว

      Hi, I don't really get what you mean by components being modified. Can you reduce your problem down to a minimum number of lines of code and then explain exactly what is happening and what you want to happen?

    • @pjguitar15
      @pjguitar15 3 ปีที่แล้ว

      @@javadave i start by creating a JFrame class then dragging and dropping components into the frame. As i do it, it creates the code by itself into the class but if i wanna edit the components i added, i cannot edit directly with code. It's the InitComponents() method that holds all the components code. Sorry if it's still confusing

    • @javadave
      @javadave  3 ปีที่แล้ว +1

      @@pjguitar15 I get it, you are using an editor to create your user interface. I wonder if the editor is somehow locking you out of the code, somehow making it read only (I'm only guessing here). Can you see the code? If you can, perhaps you could do the design with the editor and then copy/paste the code into a new project and then edit it there.

  • @princekachu1840
    @princekachu1840 2 ปีที่แล้ว

    Hey, I hope to receive a reply. I just wanna ask how to automatically enlarge my internal components inside a panel when it is maximized -means that when I maximized my frame to its full state, the components inside the panel should follow the resizing and still stay in their current positioning as they were before it is maximized. I'm using GUI builder btw, thanks!

    • @javadave
      @javadave  2 ปีที่แล้ว

      Hi, Java layouts are quite good at this. If you use a GridLayout this should just work. BorderLayout I think will only make the central component larger (this is useful if you imagine a canvas type application with toolbar, status bar etc.). FlowLayout doesn't do it and FlowLayout is the default, so you need to change it. I'd recommend using GridLayout/GridBagLayout and experimenting with those. You still have the problem of font sizes not resizing but you should find your components grow with the window. So, in summary, do setLayout(new GridLayout(2,2)); ...then add a button... then resize - you should see the Button occupy 1/4 of your window no matter how big you make it.

    • @princekachu1840
      @princekachu1840 2 ปีที่แล้ว

      @@javadave Thanks, I appreciate this. So as you said, I still have the problem with the words not resizing by themselves automatically. Does that mean I should do it manually (resize the jlabel when I click the button to maximize my frame)?

    • @javadave
      @javadave  2 ปีที่แล้ว

      @@princekachu1840 You could do a window resize listener and then set the font on the components. Somehow, this doesn't seem like good practice to me though. Another thing to think about might be setting the maximum size of your window so it doesn't get too much larger than you want.

    • @princekachu1840
      @princekachu1840 2 ปีที่แล้ว

      Thanks! Great videos btw, keep on coding!@@javadave