Chris G Johnson

+ Follow
since Nov 20, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris G Johnson

I am doing a project and part of it means I have to come up with a mobile application to emulate a normal mouse but wirelessly through Bluetooth. So far I recon i'm gonna have to use J2me and maybe JSR80 or the wireless toolkit for J2me? Also in what format do I send the commands to move the mouse? e.g. Single Click<SERIAL-MARKER><esc>,click.

If any body had some sample code that had the basic functionality of what i am looking for then I would be really grateful to see it.


Chris J
15 years ago
I have been told that i need to make use of the @link tag in some software I am writing to be able to get a good grade. I have looked all over the internet and on the java website and nothing is specified on how it is used.
Can anyone here help?
17 years ago
What is wrong with forums these days? I remember when you could post a question one day and get a solution the next without all this nonsense of posting questions in the wrong place. Why do people bother answering a topic if it is just to tell the poster that they aren't going to answer the question?
I would be glad to hear from someone who can at least give any useful information, I have already said that i know that there is a lot of information on the web on this problem, but so far I have not found any to be a good solution.
I need to find a good java forum anybody know where I can find one?
17 years ago
I have an applet that connects to a MUD server on port 23. I know that the applet has worked before but for some reason the access is now being denied, whether this is because of the java security policy, i am not sure. This is the actual error message that I am getting:- access denied ( resolve)

Can anybody please help with this, i have heard that the applet needs signing but there are just so many different ideas and suggestions on how to do this, i am unsure of what to do for the best. I also have heard that jar files can be signed but again i'm not sure and the program is not currently being run from a jar as I wouldn't know how to do that.
The only other point that might be important is that recently my IExplorer has been playing up, probably because of some virus or adware and so i have been using aol's browser, will this stop access being granted? I have added a couple of lines to the java policy file to grant permission to any server like "*" resolve & "*" connect, but so far this has made no difference.
17 years ago
This is the Dice class:-

This is my diceView class:-

17 years ago
Yeah it does extend JButton , but I can't post the code at the minute as i'm at work. I will post it about 5.00pm. Cheers
17 years ago
I have got a Dice program that displays dice on a JPanel in the form of a button.

To instantiate the Jbuttons/dice I use:

Dice die1 = new Dice(diceModel.getFaceNumber());

This applies a corresponding face image with the number that is retrieved.

If I click the button the rollDice method is called which retrieves another random number and gets a new face image. The problem I have is that I don't know how to apply this face image to die1 and how to repaint it on the panel.

I have tried using Dice die1 = new(etc, etc, but I just get a totally different dice. All I want is to refresh the current die1 button with a new image. Any ideas?

The roll Dice method uses setIcon(icon) and I'm pretty sure that the correct image is being generated its just that I can't seem to display it.
17 years ago
How do I use the class though, can I just create buttons from the class as normal and use the inherited methods?
17 years ago
You are supposed to get others to help, you can use whatever resources you can find as this is defined as solving the problem.
17 years ago
Have already tried that but this module is supposed to be about problem solving so they are not supposed to help. You're meant to get help from others or books. The main problem I am having is understanding the part Extends JButton
17 years ago
Hi all,

I have been given an assignment to produce a dice roll game in Java. I have also been given the dice class which I think is going to be used to display the dice images. The code for this is below:-

The game will consist of 24 dices shown on the screen in rows of 6 x 4 and then at the end of each row the program will calculate the number of dices that show the same value in a particular row.

Now I already know that I am probably going to have to use different classes for calculating and controlling the dice, but how do I link them together? I also need to use a harness class to start the program is this just a main & constructor in a seperate class?

The only other thing which i am very unsure about is what classes do i need and how can each component of the program be split up into each class?
If someone could draw me a rough uml diagram to explain this would be very helpful.

Thanks to everyone (in advance)

[ EJFH: Fixed code tags. ]
[ February 18, 2005: Message edited by: Ernest Friedman-Hill ]
17 years ago
Yeah I had somehow declared it twice but I think that i've fixed it.

17 years ago
I am using ActionListener to listen for JButton presses. I have tested the actionPerformed method is called by putputting a string when an action occurs. But when I say:-

Nothing happens.

I have done System.out.println(""+ae.getSource()); and got something like

javax.swing[,7,0,7,etc - should the identifier come before the first comma.

I have seen some other ways like, if(ae.getSource().equals(addOrder)) do think could resolve the problem.

Thanks in advance for any help.
17 years ago
Hi, I have a problem with the code below:-

The public string toString() method doesn't work and produces a class cast exception: null, Ithink this is because the arrayList is empty but I can't figure out why it is empty.

Thanks in advance to anyone who can shed some light onto this problem.
17 years ago

I am creating a program that makes a list of products that are used to create orders which are added to an orders queue. The thing is I don't know the first thing about arraylists and just can't understand what I need to do. This is my code so far:-

So far all I have is a list of methods that I don't know how to use. How do I store food items in an order if each arraylist can only hold one object.
I am so confused and am considering throwing the towel in.

Thanks in advnaced to anyone who can help!!
17 years ago