How do you get around using codenameone designer to make a functional radio button. I have tried to create in on my form and made properties to be:
UIID: RadioButton
Icon: radioEmpty.png
PressedIcon: radioFull.png
Toggle: [checked]
it still will not work like a radio button, is there something am missing or what am I doing wrong. Please help. Thank you.
You need to define more than one radio button and set them all to the same group name.
Related
I got CheckBoxMenu Items in a Menu to select filters I got. I found out that I can't use setHideOnClick on CheckBoxMenu so I used CustomMenuItem with a CheckBox inside, but now I can only click the box and its text to ckeck the box instead of the whole highlightened field. Is there any way to expand it to the width of the CustomMenuItem?
I got the same Problem like this:
JavaFX MenuItem without autohide
But the solution doesn't work 100% and in a comment there is the same question/problem I have now.
Greets
I'm fairly new to android Java and I was wondering if you could assign a value to a radio button, check box or button like you can with HTML?
I have data coming from MySQL which I would like to be assigned to radio buttons.
Yes that is possible in Android.You can add it dynamically(programmatically) in the code.Refer the below link for how to do it How to add radio button dynamically as per the given number of counts?
Yes you can assign value to radio button , Check box and Buttons.
Please follow a good tutorial for android.
Please check this Link
Hope this helps.
how can I create (with JAVA) Combobox that contains Checkboxes for multiple selection and display the selected items in the Combobox like this picture:
click to see the pic
and thnx for advance.
EDIT:
I found this API (JAPURA API) and it's great but when I select multiple things I want to display the selected items instead of "* multiple items *".
Here's the link to achieve your goal:
JComboBox Providing a Custom Renderer
I would suggest you create a JButton and style it in the form of a Combobox if you want that.
Then, at the onclick function (actionperformed), you create a JPanel and make it visible under the button. In the panel, you can put whatever you want, so you just put checkboxes there.
I know this is kind of a workaround of your problem, but it should be easy for you to do so, and the actual user does not see a difference at all.
Hope I could help you.
Cheers,
Lucky
I've two jRadioButtons in Java application. Let's say Male and Female. Initially one is selected. While selecting another, the previous should be unselected and vice-versa. How to make it work? Also how can it be used to store in database?
You can give same name to all the radio buttons, from which you want to select only one. That way, you will be able to select just one button out of all. This you can do by creating a ButtonGroup.
Now, if you want to add the selected item to the database, just get the value corresponding to the name of Button Group, you will get the value of selected button.
See documentation and tutorial
What you need to use is a ButtonGroup component. Have a look at: How to Use the ButtonGroup Component
I want my users to choose something in one of my screen but i'm tired of the spinner. Can anyone suggest how can i add a cooler way to choose stuff?
If you're tired of a spinner, why not create your own styled dialog to select things. You can make it look however you want.
If you don't have too many options and/or they are labeled with short texts, you can consider using RadioGroup with radio buttons. This would of course go either directly on your activity (taking more space than a spinner) or inside a custom dialog.