Hello,
I am a newbie at programming and have a question. The variable fnh is not being stored in the fullFNH in the second file, only in fnh in the first file. Can someone suggest me what I could be doing wrong? Thanks in advance.
// AlladinLamp.java - import statements go here
-
-
public class AlladinLamp {
-
-
int fnh;
-
JComboBox runners;
-
other variables go here
-
-
actionListener and other methods go here, including
-
-
public int getFNH() { return fnh; }
-
-
ActionListener runnersActionListener = new ActionListener() {
-
@Override
-
public void actionPerformed( ActionEvent e ) {
-
String runnersNumber = ( String )runners.getSelectedItem();
-
fnh = Integer.parseInt( runnersNumber );
-
hNam = new String[ fnh ];
-
hNum = new int[ fnh ];
-
hVal = new int[ fnh ];
-
jtxt = new JTextField[ fnh ];
-
reducedFNH = reduce( fnh );
-
}
-
};
-
-
-
-
public AlladinLamp() {
-
-
gui built here...
-
-
String[] numberOfRunners = { "8", "9", "10", "11", "12",
-
"13", "14", "15", "16", "17",
-
"18", "19", "20", "21", "22" };
-
-
runners = new JComboBox( numberOfRunners );
-
runners.setMaximumRowCount(5);
-
-
-
runners.addActionListener( runnersActionListener );
-
-
...
-
}
-
-
public static void main( String args[] ) {
-
-
SwingUtilities.invokeLater( new Runnable() {
-
@Override
-
public void run() {
-
AlladinLamp lamp = new AlladinLamp();
-
}
-
});
-
-
}
-
-
-
// Process.java
-
-
import statements go here
-
-
public class Processes {
-
-
int fullNH;
-
AlladinLamp lamp;
-
-
public Process() {
-
-
lamp = new AlladinLamp();
-
fullNH = lamp.getFNH();
-
-
...
-
-
}
1 1380
Post the actual code that you used. What you posted doesn't even compile.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: harishg2 |
last post by:
Hi,
How to store a variable value for more than one executions.
Ex:
main()
{
int i=0;
i++;
printf("%d",i);
|
by: Boltar |
last post by:
Hello,
I am relatively new to C#.
There is a particular address in memory on my computer that stores a
string value. The address is 57E777.
Does anyone know how I can retrieve the string...
|
by: Varadha |
last post by:
Hi,
I am declaring a variable
static char Version_No = '1' in header file header.h
In a application "app.exe", i am changing the value of the
variable in to '2'
In the same application i am...
|
by: Helpseeker |
last post by:
Hi all,
I have written a small code in which i declare a static int variable and
increment its value by one each time i click on a button. actually i use the
int variable value in a particular URL...
|
by: John Smith |
last post by:
Hello, I have a simple question,
I have a vb.net form with several buttons.
If I store the name of a button in a variable..
Dim TheName as string
TheName = ...
| |
by: tharika_c |
last post by:
Hi,
We have a simple ASP.NET web application where one of the Session
variables, called Session("SSO_ID") gets created and assigned a value
(equal to the HTTP_HRID request variable value),...
|
by: Vbbeginner07 |
last post by:
Want to change the value stored in the bold, it's a code to calculate the payroll.
If txttr.Text = "" Then
Form2.txttamt.Text = ""
MsgBox "enter the tax rate", vbOKOnly, "ERROR"
...
|
by: pendem |
last post by:
I mean can set a variable value in a script to be unchanged even after page reload?
for example if i set a value of a global variable "val" to 2 ; so using onbeforeunload() or onunload(), i will...
|
by: sweetneel |
last post by:
hi all, thanks in advance. I need a help , its urgent.
I am developing a webapplication with maser page. there i have a lebel, control. i need to update its value from the content page, and only...
|
by: dsatino |
last post by:
I'm sure I've actually done this before, so why I can't figure this out now is annoying. I'm hoping someone can spark my memory here.
Basically, I have 54 variable names stored in an array. I...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |