Questions tagged [buttongroup]

buttongroup refers to bootstrap button groups. A button group is a series of buttons grouped together either horizontally or vertically by a parent element with the role group and the class btn-group.

refers to bootstrap button groups. A button group is a series of buttons grouped together either horizontally or vertically by a parent element with role="group" and class="btn-group".

Button groups is supported in all versions of bootstrap. Example :

<div class="btn-group" role="group" aria-label="Basic example">
  <button type="button" class="btn btn-secondary">Left</button>
  <button type="button" class="btn btn-secondary">Middle</button>
  <button type="button" class="btn btn-secondary">Right</button>
</div>

Recent documentation :
http://getbootstrap.com/components/#btn-groups (bootstrap 3)
http://v4-alpha.getbootstrap.com/components/button-group/ (bootstrap 4)

205 questions
3
votes
3 answers

onLongClick listener for group of buttons in Android

In my Android application, I want to create a fragment that works like a keypad. I have one function which handle onClick for all 9 keys. I want to know is there anyway to write just one function to handle onLongClick for all these 9 keys too. here…
Massih
  • 33
  • 1
  • 1
  • 6
3
votes
0 answers

How do I iterate over a ButtonGroup in Swing?

I have a group of RadioButtons in a JPanel. I want them to have a green background when not selected, and a red background when one is selected. By the very nature of JRadioButtons, only one should be red at a single time. My problem is that setting…
sdasdadas
  • 23,917
  • 20
  • 63
  • 148
3
votes
1 answer

Clearing a group of radio buttons in Java

I have a program which prompts users to select a choice out of four options (from a group of RadioButtons). Once the user has made a choice, he/she clicks a button and then receives a message. After closing the window, the user will go back to the…
PAT
  • 61
  • 1
  • 1
  • 9
3
votes
1 answer

How to enforce at least one checkbox in a group is selected?

ButtonGroup is meant for radio-buttons and ensures only one in the group is selected, what I need for check-boxes is to ensure at least one, possibly several are selected.
Tibi
  • 530
  • 6
  • 8
3
votes
1 answer

How to add JRadioButton to group in JTable

I have added radio buttons to a JTable using renderer and editor. I have also created group for the same. I'm unable to achieve the exclusiveness (only 1 radio button should be selected) using this principle. Please see my code below and appreciate…
monk
  • 51
  • 1
  • 3
3
votes
2 answers

What SWING elements can be added to ButtonGroup that make sense?

Although, every AbstractButton can be added to the ButtonGroup (according to the Java API), i wanted to ask, which elements really make sense to get added. The following two definitely do: JRadioButton JRadioButtonMenuItem I wanted to know about:…
user898535
  • 207
  • 1
  • 2
  • 9
2
votes
1 answer

returning value out of ButtonGroup()

I am having problem to return a simple int value out of radiobutton i have created. static int f5(String question) { int intValue = 0; answered = false; JFrame f = new JFrame(question); …
Joe Park
  • 139
  • 3
  • 12
2
votes
2 answers

adding ButtonGroup to Box-layout object

When I try to put ButtonGroup object to my Box object, compiler returns the following error: no method for such a type Please help me, how can I add my ButtonGroup into Horizontal Box?
Ariel Grabijas
  • 1,472
  • 5
  • 25
  • 45
2
votes
2 answers

How can I determine which JCheckBox caused an event when the JCheckBox text is the same

I am working on a program that needs to determine which JCheckBox was selected. I am using three different button groups, two of which have overlapping text. I need to be able to determine which triggered the event so I can add the appropriate…
Nick
  • 33
  • 1
  • 7
2
votes
1 answer

Grouping about 100 Radio Buttons

I'm trying to create a multiple-choice test with approximately 100 questions in it. In this example, I give you a group of radio buttons. I solved creating multiple radio buttons with this code. However, I want to group these selections. I found a…
Fatih Tüz
  • 133
  • 1
  • 12
2
votes
1 answer

Getting input from multiple button groups in Java

I have an array of question, an array of possible answers and an array of properties I want to find out by answering the questions String[] questions = new String[]{"Question1", "Question2", "Question3"}; String[] possibleAnswers = new…
Dobro
  • 31
  • 6
2
votes
2 answers

Bootstrap drop-down and button in group

I would like to have the code below to look like the image with Bootstrap 3.3. When there isn't enough space to display all elements in one line they should form a vertical group where the elements use the whole screen width. Addition: My…
floriegl
  • 21
  • 1
  • 2
2
votes
1 answer

Bootstrap ButtonGroup Select 1 Button Only

I am using Boostrap 3.3.7 and are trying to use Buttons as 'Radio Button'. This is the HTML:
RonaDona
  • 912
  • 6
  • 13
  • 30
2
votes
1 answer

how to disable active toggle on bootstrap button group

I like bootstrap button group style, I don't like the active toggle. I can't disable the active state, unless I click out of the button. How can I disable the button toggle? can't find active class
Weijing Lin
  • 575
  • 2
  • 5
  • 16
2
votes
2 answers

Adding value to JRadioButton

I'm trying to make a sort of simple soccer simulator. This is the code I created after watching tutorials and i know its pretty bad. All i want to do is add a value to the team, like 1 for the best team and 10 for the worst, and when i choose a team…
1 2
3
13 14