Shane Lilly

Greenhorn
+ Follow
since Feb 20, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Shane Lilly

If I were to draw an image on something like photoshop, just a menu of sort that shows which key provide which events...
Could I then place this image onto a JPanel and show it in a JFrame??
Could anyone post a code fragment of how to do this...
Thanks.
21 years ago
Hi,
I am drawing a menu bar on the side of a canvas. I have a series of JLabels describing what various key strokes do.
However below this I would like to draw a key showing what colours in the canvas represent.
Is there any way that I have do something where I have a small image then beside it some text describing what the color represents?
Say the box below is the JPanel...

|----------------�
|<image><JLabel> |
|<image><JLabel> |
|<image><JLabel> |
|<image><JLabel> |
| |
| |
| |
|_________________|
This is the effect that I would like to get.
Thanks.
21 years ago
Apologies, this was already answered!
Disreagard this post!
21 years ago
Can anyone help as to how I can draw buttons in a downwards column, one button under another.
THanks.
21 years ago
Sorry, just reading over that, I will make it a little clearer!
I want two panels, one on the left of the container, and one on the right. The one on the left I want for the buttons, so that the buttons are displayed one under the other.
Thanks again!
21 years ago
Hi,
I know the difference between the two layouts in the title, that FlowLayout adds onjects onto the canvas one after each other in a line from left to right, then taking a new line when the edge of the canvas is reached. Also that BorderLayout can be set to the NORTH, SOUTH, EAST, WEST and CENTER of the canvas.
What I'm having trouble with is getting them to do what it is I'm after!
I want to have a column of buttons on the left of the canvas, the column only being one button wide. Then the rest I want to use to draw on, i.e. like a user menu on the left and then when buttons are pressed they are drawn on the main part of the canvas (the right section).
Can anyone help me do this? I've been playing obout with the Layouts for ages, and just end up going round in circles!
Thanks
21 years ago
Hi I have an array of double values and i am then using this array within a switch statement...
switch(timevaluesarray(iCount) {
...........
}
When I compile the code I get the error 'loss of precision', where a double is found but and int is required. Is there a simple line of code that can change the values in the array from double to int??
The values being fed into the array are required to be double so i can't change them before they are put into the array.
Thanks for any help!
21 years ago
How do I implement this in a java file...
Im in the middle of a for loop and I want a small delay before I do the next thing in the for loop.
When I include Time.Delay(100);
It gives me an error 'Cannot resolve symbol'.
Is there a java class that I need to import in order to use this, or am I going the wrong way about it?
Thanks
21 years ago
I'm finding it hard to follow that! i.e. where to implement that into my code!
What I have at the minute is I am able to pass through one value from the 'public String decodeMessage' in MidiReceiver.java by calling a method in myOpengl.java 'getIntValues(iMidiValue)'
the code for the getIntValues is as follows...
public static void getIntValues(int val1) {
System.out.println("myOpengl midivalue = " + val1);
}
This prints out the console fine... but when I try to make a public variable equal to the integer passed into the static method above, I get the error, 'Non-static variable cannot be referrenced from a static context'.
Is there any way to get around this??
I have already tried changing the method to 'public void getIntValues' but when I run the program and it tries to pass the integer from decodeMessage method in MidiReceiver.java to getIntValues method in myOpengl.java I get a java.lang.IncompatibleClassChangeError
I think this is because the whole MidiReceiver.java file is being called from a static call in myOpengl.java
'private static Receiver midi_receiver = new MidiReceiver()'
So ultimately is there any way to make a static variable public to the rest of the class??
21 years ago
Yeah if you can provide more info on the enctype of the form submitting the upload I might be able to help!
21 years ago
JSP
really all i want is to be able to take the values that are extracted from the class 'decodeMessage' and then pass them into the myOpengl.java file so that with the myopengl.java file they can be implemented as global variables.
sorry for all the confusion, i've been told before that im not very good at explaining myself!
21 years ago
so could anyone give me a real idiot proof guide of how to go abt my problem...
im thinking that maybe i am blowing it out of proportion and that its quite simple, but it doesn't seem that way to me at the minute!
i think i understand what a few of the posts are trying to do, but im sorry to say that i am stuck as to how to implement these strategies into my code...
thanks
21 years ago
Here are a few code fragments of what i am doing...
myOpengl.java

MidiReceiver.java

What I want to do instead of printing the values on the console, I want to take them as they are extracted from the midi file and then pass them into the first java file (myOpengl.java) so that i can then use them as variables so that i can plot 3d shapes with them....
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ February 25, 2004: Message edited by: Dirk Schreckmann ]
21 years ago
sorry, i will make myself a little clearer...
Within my original 1st java file I am using a form of openGL and java binding called JOGL. This is a 3d programming interface. Within this 1st java file i aim to complete 3d programming and drawing aspects.
From the first java file i am calling another java file to read the contents of a midi file, i.e. the musical note values, timings, etc.
Upon getting these values within the 2nd java file i then want to pass these back to the original 1st java file where i can use these parameters as variables to be used in the 3d drawings.
There will be probably at most three kinds of integer values that i will want to pass to the 1st java file. These integer values will represent musical events from the midi file.
Im just having problems passing them through...
so hopefully this explains things a little better. Any help would be gratefully appreciated!
Thanks
21 years ago
Hi,
I am looking to just get the name of the file when using the JFileChooser interface. So far I am using...
File selectedFile = chooser.getSelectedFile();
System.out.println("Filename = " + selectedFile);
... This gives me a print out of the whole address of the file in question, eg an output of "C:\Documents and Settings\Shane\Java\File.txt"
Is there any command or code fragment that I can use to simply get the name of the file, "File.txt"??
Thanks in advance,
Shane
21 years ago