Paul Wright

Ranch Hand
+ Follow
since Oct 05, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Paul Wright

Violet is an open source graphics editor that some of you may be familiar with. A client wishes me to add another graph type to the editor to which I have done.

Now what I need to do is to be able to group objects together. I have created a larger object and I need to be able to drag smaller objects (nodes) into the larger one to which they will then become part of the larger one.

Ive had a look at the composite pattern but am having trouble finding a way to implement this.

Anyone know the framework on how to add objects to a larger object by dragging them to within the boundaries of the larger one.

I know what im asking is sort of vague but anyone know have code of previous examples where this has been done.

Any help in this matter would be much appreciated.
18 years ago
Anyone got any code or know where I can find some to demonstrate this pattern? Ive got a couple already but they arent graphical enough for the purposes I am trying to demonstrate. Something with a GUI would be good.
Its difficult in todays economy to convince small companies to fork out the money for the extra cost involved in developing a more secure system. Is there any particular method or formulae that you use to persuade these people to go the extra mile ie Cost vs Loss analysis?
19 years ago
Its difficult in todays economy to convince small companies to fork out the money for the extra cost involved in developing a more secure system. Is there any particular method or formulae that you use to persuade these people to go the extra mile ie Cost vs Loss analysis?
19 years ago
Either do I actually. What I will do is next week sometiime I will stick the entire source code up on my webpage and you can compile it and pull it to bits. Or play it.
19 years ago
No i thought that at first but when doing the harder puzzles there is a lag time of about 5 seconds while it is solving(hence the need for the solving indicator) and it doesnt work. It shows all messages but the "solving" at the beginning. It cant print to any other textfield as there arent any.
19 years ago
I have this bit of code in my application. Its for a sudoku solver. When the user presses the solve button it should write to a JTextField stating that it is "solving" then once solved should rewrite to the same textfield "no errors". The problem I am having is that is it not writing the first solving and regardless of what I try it wont write.

You will see the System.out.prinln() functions. They work and write the exact thing that should be in the jtextfield.

Is there something about actionlisteners or jtextfields im not getting? Maybe something to do with the refresh rate or something....

Any help would be much appreciated.
19 years ago
Dude your a legend. Wrote it up and compiled ok and runs sweet.

If your ever in Perth, Western Australia I will buy you a beer.

Thanx heaps.

PS. I sorted out moving the cursor around the grid easy enough. I just used:



Or something of thereabouts.
19 years ago
Thanx heaps but im still getting an error when the solver extracts the numbers from the grid.
Ive set up my grid different from yours.


The problem im getting is you can still enter more than one number in certain grids and not others. If you enter a number then delete it when you click out of the grid it comes back. The solver is finding more than one number in the grid as well.
I am at a loss as to how to fix this.

Anyway its doing my head in and I know the code ive given isnt much help.
How do I navigate around the grid using the arrow keys? Im not sure how to set up the key listener to get focus from one textfield to another.
[ October 22, 2005: Message edited by: Paul Wright ]
19 years ago
I have been trying to get a formatted textfield working. I need it to only accept a single digit from 1 to 9 or be empty. Its for a Sudoku program.

It is working fine but will only let me enter numbers in a certain order.
Sudoku is a 9x9 grid of textboxes. This is made up of 9 3x3 subgrids. It wont let me just place a number in the grid at random. I have to find the one that is editable then its fine from there when what I want is for all of them to be editable.

Im using a MaskFormatter and its working fine in that it only allows me to enter a single digit when it allows me to enter anything at all.

Is there an easier way to get a textfield to only accept one digit from 1 to 9 or blank?

Any help would be much appreciated.
19 years ago
Well hes got a few replies already without one...... so imagine the response if he did ask a question.
You may have bandwidth problems if and when he does.

As for the good question theory...... ive only ever asked stupid ones and always got replies. I think people feel sorry for me.
Thanx for that. I used the sendDirect(String url) method.

Was just what i was after.
20 years ago
Not sure it really matters. I would imagine that the Java double would cover the MySQL decimal( in decimal places) whereas float would be more extensive if you get my drift.
Like float goes to alot more decimal places than double and probably more than the MySQL decimal format.
Plus double is a smaller value. I think its only 16 or 32 whereas float is 32 or 64. One of the two i cant remember which.

You can see my knowledge on the subject is quite extensive.
Ive created a series of servlets of which when the user logs on they get directed to different pages.

My question is how do you make an HTML page come up after the servlet has run.
I know how to do it by generating the code inside the servlet with output.print(); but I just want it to say:
If (condition)
Then (go to this page)
Else (go to this page)

Is this possible or do i have to generate each page inside the servlet?
20 years ago