B4J Question Button in textfield

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

it's possible to add a button into an textfield ?

Thanks
 

Star-Dust

Expert
Licensed User
Longtime User
I believe you can do it with BBTextEngine, in the text you can include a button in the text

 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I´m not sure if a B4J Button is äquivalent to a JButton.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I don't know if I understand correctly. But it looks like several custom views of TextView editable with confirmation button.
If I understand correctly you can find several in the forum but it would be easy to create it as a custom view. (see here)

But I'm not sure that's what you're looking for
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The solutions in the link are just adding a textfield and a button to a pane and adjusting the positions. albeit not in javafx. So a customview would make that straightforward.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
A quick and dirty example. Using the extracss to change the textfields right inset, and delegating some of the callbacks.

It may look better with a label instead of a button.
 

Attachments

  • BtnToTextField.zip
    4 KB · Views: 178
Upvote 0

stevel05

Expert
Licensed User
Longtime User
That's exactly the solution, how it is implemented depends how you want it to look. Moving it inside or over the textfield makes it look like one control.
 
Upvote 0

Similar Threads

Replies
2
Views
980
Replies
1
Views
2K
Replies
5
Views
2K
Top