Associate a JList with radio buttons
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I got a JList
which I fill with mesure types. The user can fill it by select mesure type from a combo box and fill the list. I have also 5 characteristics radio buttons which normally set the characteristic of the mesure, so for each mesure type, there is 5 different options.
I draw a schematic of the window:
+-------------+
|Mesuretype1 |
|Mesuretype2 |
|Mesuretype3 |
+-------------+
°option 1 °option 2 °option 3 °option 4
Is this possible, and is there a manner to associate the list with the radio buttons, and save the state of them (like the first mesure have only option 1, the second option 3, e...)?
To finish the program, after having choose different mesures and the options associated, the user clicks finish and all data is saved to database.
I work with Java Swing.
java swing jlist jradiobutton
add a comment |
I got a JList
which I fill with mesure types. The user can fill it by select mesure type from a combo box and fill the list. I have also 5 characteristics radio buttons which normally set the characteristic of the mesure, so for each mesure type, there is 5 different options.
I draw a schematic of the window:
+-------------+
|Mesuretype1 |
|Mesuretype2 |
|Mesuretype3 |
+-------------+
°option 1 °option 2 °option 3 °option 4
Is this possible, and is there a manner to associate the list with the radio buttons, and save the state of them (like the first mesure have only option 1, the second option 3, e...)?
To finish the program, after having choose different mesures and the options associated, the user clicks finish and all data is saved to database.
I work with Java Swing.
java swing jlist jradiobutton
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47
add a comment |
I got a JList
which I fill with mesure types. The user can fill it by select mesure type from a combo box and fill the list. I have also 5 characteristics radio buttons which normally set the characteristic of the mesure, so for each mesure type, there is 5 different options.
I draw a schematic of the window:
+-------------+
|Mesuretype1 |
|Mesuretype2 |
|Mesuretype3 |
+-------------+
°option 1 °option 2 °option 3 °option 4
Is this possible, and is there a manner to associate the list with the radio buttons, and save the state of them (like the first mesure have only option 1, the second option 3, e...)?
To finish the program, after having choose different mesures and the options associated, the user clicks finish and all data is saved to database.
I work with Java Swing.
java swing jlist jradiobutton
I got a JList
which I fill with mesure types. The user can fill it by select mesure type from a combo box and fill the list. I have also 5 characteristics radio buttons which normally set the characteristic of the mesure, so for each mesure type, there is 5 different options.
I draw a schematic of the window:
+-------------+
|Mesuretype1 |
|Mesuretype2 |
|Mesuretype3 |
+-------------+
°option 1 °option 2 °option 3 °option 4
Is this possible, and is there a manner to associate the list with the radio buttons, and save the state of them (like the first mesure have only option 1, the second option 3, e...)?
To finish the program, after having choose different mesures and the options associated, the user clicks finish and all data is saved to database.
I work with Java Swing.
java swing jlist jradiobutton
java swing jlist jradiobutton
edited Jan 3 at 15:45


Andrew Thompson
154k29165349
154k29165349
asked Jan 3 at 14:22


Benjamin BurgetBenjamin Burget
12
12
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47
add a comment |
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47
add a comment |
1 Answer
1
active
oldest
votes
From your question, the most I am gathering is that you want a way to associate one "MesureType" with only one option from the radio button.
By utilizing the Hashmap util, you can map the two together, so that a MesureType is associated with a selection from the radio buttons. For example:
HashMap map = new HashMap();
map.put( your list.getSelectedValue(), the selected button value);
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54024180%2fassociate-a-jlist-with-radio-buttons%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
From your question, the most I am gathering is that you want a way to associate one "MesureType" with only one option from the radio button.
By utilizing the Hashmap util, you can map the two together, so that a MesureType is associated with a selection from the radio buttons. For example:
HashMap map = new HashMap();
map.put( your list.getSelectedValue(), the selected button value);
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
add a comment |
From your question, the most I am gathering is that you want a way to associate one "MesureType" with only one option from the radio button.
By utilizing the Hashmap util, you can map the two together, so that a MesureType is associated with a selection from the radio buttons. For example:
HashMap map = new HashMap();
map.put( your list.getSelectedValue(), the selected button value);
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
add a comment |
From your question, the most I am gathering is that you want a way to associate one "MesureType" with only one option from the radio button.
By utilizing the Hashmap util, you can map the two together, so that a MesureType is associated with a selection from the radio buttons. For example:
HashMap map = new HashMap();
map.put( your list.getSelectedValue(), the selected button value);
From your question, the most I am gathering is that you want a way to associate one "MesureType" with only one option from the radio button.
By utilizing the Hashmap util, you can map the two together, so that a MesureType is associated with a selection from the radio buttons. For example:
HashMap map = new HashMap();
map.put( your list.getSelectedValue(), the selected button value);
answered Jan 3 at 19:40
user10864274
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
add a comment |
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
Thanks for your help, it worked like a charm !
– Benjamin Burget
Jan 4 at 12:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54024180%2fassociate-a-jlist-with-radio-buttons%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
By "mesure types" DYM "measure types"? The second I don't understand, but as to the first, I've not even heard the word 'mesure' before.
– Andrew Thompson
Jan 3 at 15:47