Hi, here is some of my code
public class ControlIL extends JFrame implements ActionListener, ListSelectionLi stener {
private JList Items;
//builds the UI
public ControlIL(){
DefaultListMode l model = new DefaultListMode l();
JList Items = new JList(model);
}
I want to be able to add to the List when a certain button I have is pressed,...
User Profile
Collapse
-
Very frustrating problem with JList
-
Need help using Sliders
I have come across a problem when using JSlider: I Know how to use sliders, the rest of my code has a few other sliders, they all work fine, but for this slider, when I use the setValue function, it does not change the cursors position, it does however change the numerical value of the slider, i checked using the getValue function, can someone tell me why the cursors position is not being updated like I want? is it because the code to update it... -
Quick question about Arrays
Hi, say i have a class and I create an array within the constructor in the class, and then i have a method and i want to add to the array in that method, how would I go about doing that? (my array is an array of Grade objects in a Grade support class i have made)
here is what i have been trying:
[CODE=java]public class GradeList {
public GradeList(int n) {
Grade[] grades= new Grade[n];
... -
New to Java, and just can't fix a little problem
Hi, the following is the code that I have written, basically I have a panel with two buttons, one that when clicked generates two random numbers and places them in separate text fields, a text field that lets the user enter the value of the two random numbers multiplied together, and a button that lets the user know if the value entered was right or wrong. Here is my problem...with each click of either button, my random numbers are being refreshed... -
Question about arrays.
If anyone can give me an algorithm or some insight for this I would greatly appreciate it.
Let's say I have an array of 8 integers, what I would like to do is to be able to give each position in the array a name to represent it, for example
if I had array[0]=5, I'd like to be able to give that position the name "positionze ro" or something along those lines.
Ultimately what I want to do is to be able... -
A little help using some functions for a Heap
Hi, I have a question regarding the use of a couple functions I have for an assignment.. first here is the header file that im trying to use
//---------------------------------------------------------------------------------
struct DataType
{
int key;
string name;
};
class Heap
{
public:
bool insert(DataType inData);
bool retrieve (DataType& outData);... -
Programming Ackerman's function
Ok, here is my code, which works fine, for implementing ackerman's function.
The question I have is, since the function's value increases so quickly, the numbers become so large so fast that the program just crashes if anything after A(3,4) is entered. I assume this is because the variables are only able to hold into the two billion range and the output would be much much higher, so the program crashes when the output would be out of the...Last edited by sicarie; Apr 2 '07, 07:48 PM. Reason: Please use [code] and [/code] tags around your code. -
Help creating a class from a program ive already done
Below is a postfix eval. program i have made, it works fine, however my professor wants me to make a header file with the class, and I tried this
class StackType
{
public:
void MakeStack(stack *S);
void Push(stack *S, float item);
void Pop(stack *S);
int Empty(stack S);
float Top(stack S);
};
typedef struct node ... -
can someone help me make an int main() program
hi, i'm almost certain all of these functions are correct and will do what I want them to do, however, i am having trouble with the main program and am having trouble making the functions interact with one another......wh at i want to do is, be able to enter a string(ex. 1+2*3) and have the output be(7). any help would be appreciated!
...Code:#include "stdafx.h"
Last edited by Banfa; Mar 7 '07, 12:26 PM. Reason: Added [code]...[/code] round diagram to preserve the spacing -
can someone help me make an int main() program
I've gotten help writing out these functions, and i know what they each do individually, but i can't figure out where to start in my main program, i want to enter a string of numbers and operators(+,-,*,/) and have the output be the answer(ex. 12+3- would be (1+2)-3=0, im almost certain my functions are fine, they compile without error, any help would be appreciated
...Code:#include "stdafx.h" #include<iostream>
No activity results to display
Show More
Leave a comment: