java


How to listen override RadioButtons in Java


I'm new with Java and I need little help to solve my problem with my application. I've got this app myApplication
My RadioButton class look like this
public class XRadioButton extends JPanel implements ActionListener {
/**
*
*/
public static final long serialVersionUID = 2L;
public JRadioButton radioButton;
public JLabel label;
public double price = 0.0;
public XRadioButton() {
setLayout(new GridBagLayout());
add(getRadioButton());
add(getLabel());
}
public XRadioButton(Icon icon, String text) {
this();
setIcon(icon);
setText(text);
}
public JRadioButton getRadioButton() {
if (radioButton == null) {
radioButton = new JRadioButton();
}
return radioButton;
}
public boolean isSelected() {
return radioButton.isSelected();
}
public JLabel getLabel() {
if (label == null) {
label = new JLabel();
label.setLabelFor(getRadioButton());
}
return label;
}
public void addActionListener() {
radioButton.addActionListener(new ActionListener() {
#Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
});
}
}
the CheckBox buttons are similar to this one
all of the buttons have different value of price
I created buttons like this
XRadioButton tSummerRB = new XRadioButton(tireS.getImgIcon(), "Summer Tires");
XRadioButton tWinterRB = new XRadioButton(tireW.getImgIcon(), "Winter Tires");
XRadioButton rimsRRB = new XRadioButton(rimsR.getImgIcon(), "Racing Rims");
XRadioButton rimsSRB = new XRadioButton(rimsS.getImgIcon(), "Sport Rims");
XRadioButton rimsCRB = new XRadioButton(rimsC.getImgIcon(), "City Rims");
XRadioButton bodyBlackRB = new XRadioButton(gtrB.getImgIcon(), "Black Edition");
XRadioButton bodyWhiteRB = new XRadioButton(gtrW.getImgIcon(), "White Edition");
tSummerRB.addActionListener();
tWinterRB.addActionListener();
rimsRRB.addActionListener();
rimsSRB.addActionListener();
rimsCRB.addActionListener();
bodyBlackRB.addActionListener();
bodyWhiteRB.addActionListener();
And the label for the TOTAL SUMMARY is
double totalSummary = 0.0;
JLabel sumInfoL = new JLabel("Total Sum ... " + totalSummary) ;
The problem is that I want my "Total Sum..." to display dynamic value , which is the summary of the selected RadioButtons and CheckButtons

Related Links

SecureSocial play 2.3
java.lang.IllegalStateException: Query argument “ ” not found in the list of parameters provided during query execution
Does this clockwise method work for polygons?
When using JNI to port in existing C++ code, use C or C++ to interface with JAVA?
How array works internally in Java?
How to get a character from a number in Java
how to reverse the json array after response from webservice?
nothing will display on the screen
Spring Security: Execute jQuery Code Only For Authenticated Users
Dynamic file path in assets reverse routing
Why is nameList.add not synchronized?
My java compiler is broken. I need help fixing it/reinstalling it
Java allowing multiple inheritance
LibGDX project can't find assets folder
how to get images from word docx in java?
Setting the maximum length of a edittext in android

Categories

HOME
wso2
atom-editor
oracle11g
drivers
kde
mfc
bpmn
jsp-tags
cvs
filtering
enterprise-library-5
mouse
azure-storage-tables
bs4
qore
portia
contact
adfs
slurm
spring-xd
zend-framework3
leiningen
msp430
try-catch
pc
flux
jqwidget
emulator
extjs5
pass-by-reference
language-agnostic
claims-based-identity
crosstab
sqlcipher
buildbot
apache-commons-io
kannel
brunch
quote
tasklet
fabric8
key-value-observing
winrt-xaml-toolkit
suricata
objectlistview
theano.scan
xenforo
ansible-playbook
webdriver-manager
optix
core-plot
fakeiteasy
wso2carbon
dotcover
dds
prolog-setof
blogengine.net
yii2-extension
mplayer
boost-preprocessor
webdriverjs
deadbolt-2
spring-android
removechild
vmware-tools
phishing
django-debug-toolbar
fputcsv
disque
yaws
php-internals
quicklisp
tarjans-algorithm
varargs
composite
p2
lustre
ng-animate
nstableviewcell
android-nested-fragment
javafx-webengine
cctv
wordpress-theme-customize
issuu
castle
funcunit
braille
gnu-smalltalk
c18
jsctypes
android-screen-support
mqx
jelly
android-hardware
free-variable
sublist
gil
jspinclude
online-compilation
code-cleanup
gnu-prolog
window-management
vdsp
subgurim-maps
xfbml
google-friend-connect
gamequery
ncqrs
fixed-width
thread-local-storage
ugc
misv

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App