Recent

Author Topic: jButton - Oval shape  (Read 287 times)

biologic

  • New Member
  • *
  • Posts: 28
jButton - Oval shape
« on: October 11, 2025, 03:44:16 pm »
Hello

How can I set the shape of a jButton to oval ?

With this code : The buttons turn into an oval when I tap them. Not when the form is shown.

I want them to turn into oval when the app starts.

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3. LoadButton.SetRoundCorner();
  4. LoadButton.SetRadiusRoundCorner(90);
  5. end;
« Last Edit: October 11, 2025, 07:48:10 pm by biologic »

nicelybrewed

  • New Member
  • *
  • Posts: 26
Re: jButton - Oval shape
« Reply #1 on: October 11, 2025, 09:15:53 pm »
You need to set the SetRadiusRoundCorner of the button corner prior to calling SetRoundCorner so it applies with that radius value, this is why it only shows after you tap it currently, so try:

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2.  begin
  3.   LoadButton.SetRadiusRoundCorner(90);
  4.   LoadButton.SetRoundCorner();
  5.  end;
Lazarus v3.8, LAMW v0.8.6.4-blue, NDK v22b, Android 15, Windows 11 mainly but also use LAMW on Linux.

 

TinyPortal © 2005-2018