mike ryan

Ranch Hand
+ Follow
since Aug 08, 2010
mike likes ...
Eclipse IDE Java
Merit badge: grant badges
For More
Germany
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
16
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mike ryan

Hi Jeff,

Thanks for the help, sounds allot more difficult than i had thought! I will read up on key/value pairs (java.util.Properties) and see if i can do it that way. This is all new ground for me so will have to try it and see what i get.

Thanks
Mike
11 years ago
Hi,


Well i need to have them there on start up, and then need to be able to change one which will happen once every six months and sometimes in between. I would actually like to use an array as this is a small amount of data anyway, i am currently trying to write to the file using this method


I am having trouble at the moment with NumberFormatException as there are numbers and letters in the array while using the putInt(Integer.ParseInt(aktuelleNummer)), so am trying to work around it but no luck so far...not sure how to get around that problem.


Thanks
Mike
11 years ago
Hi Jeff,

Thanks for your reply! I can save the currentFilterNumber[0] of course while the program is running but it needs to be saved when the porogram is closed and kept in a text file. So my question regarding getting the variables from a text file directly or having a list be updated from the text file i meant can i just save these variables only in a text file and have them called when the program runs, or do i even need a list or array to keep them as well? I suppose i would use a list to get the variables from that text file correct?
I will take a look at that tutorial you mentioned, i seem to have a slight problem understanding Filewriter and BufferedWriter and so on...

Thanks
Mike
11 years ago
Hi All!!

I have a question regarding getting variables for a program i am writing with a text File. I have a tabbed pane and in one tab i have a JComboBox with filter numbers using a simple array , when i pick a filter in the comboBox i then have to get a filter number from a text file. The filter numbers should be able to be changed on another tab with JTextField, then using a button once the user has typed in the new number to save that to the text file in place of one that was there.
the Filter number format is "RI1234567" for instance. I would like to know which methods i would need to use to accomplish this. I haven't done much at all in the way of IO so your help would be greatly appreciated!!

i currently have the filter numbers saved in an array --> private String[] currentFilterNumbers = {"IR4658392","IS3509856","IP1234567","IR3456987"}; but i can't change them like this, so should i get this directly from the text file? or should i have a list that is updated from the text file?

I hope i have explained my problem well enough, if not please ask and i will try to explain it better.

Thanks
Mike
11 years ago
Hi Matt,

take a look at this link , should answer most of your questions .

Mike
11 years ago
Hello Campbell,

Thanks for your response, that would be a good way to create the buttons, but i have already created them and want to have them in a list of rows.Maybe you missunderstood my question OR i don't understand your reply <--- (which is possible ;) ).

I am currently trying this with ArrayList



i will eventually need to test quite a few things in each row like if rowA doesn't equal an even number it will be false as well as if there are more than three of the same numbers beside eachother it will be false and so on,
i am thinking this will get really long with all the checks, maybe there is a better solution?

Thanks
Mike
12 years ago
Hi ,

I have a GUI i have created a gui qith 16 JButtons

example of how i created them



they go from A1-A4 to D1-D4 ,four rows.
I would like to add the JButtons to an array, how should i go about it? i am guessing it is possible but maybe i am wrong?

i would like to make something like JButton[] rowA = JButton{A1,A2,A3,A4}; -----> i am really terrible whith Arrays!!

Thanks
Mike
12 years ago
try setting the JPanel visible

12 years ago
Hi,

in reply to your JLabel not showing up,

You have to add it to something. maybe using getContentPane() or creating a JPanel and add it to that.
12 years ago
Hi Randall,

You are correct i am doing homework however the "Homework" part i already have done, but this course is older and i also like to do some extra methods and things to just make it work more like i would like it too;) I actually had started trying to use the mouseDragged event as it just seemed to make sense, but i haven't got it working yet.I also agree that it is fun working things out on your own(as long as it doesn't give me a heart attack ), but sometimes i get stuck and then i ask questions here ;)
The Graphics2D methods look cool as well but i will have to do some testing with that still.

Thanks
Mike
12 years ago
Thank you Daryll!

I will read up on the BasicStroke.
12 years ago
Hi ,

I have it working thanks allot!! The only problem with this is when drawing a straight line it won't work. I am working on how to do that now. I have another question regarding this program and the question is, In Photoshop for instance when i am drawing a shape i will get the broken line marking the area when the left mouse button is clicked , until i release it and then it is gone and the shape is there.This helps to see exactly where the shape will end up. Is this something that also has to be done with a mouseEvent or is it part of the Operating system i am using and just need to utilize this in the OS?

Also, in Photoshop the shapes are each thier own (JPanel? i think), so you can move it around and resize it, is this also possible in Java?

Thanks
Mike
12 years ago
Hi Randall,

Thanks for the help, I will have to read over that some more to understand it still.And try it with my code once i get it ;)

Thanks
Mike
12 years ago
Hi all

First of all Happy Holidays to everyone!! I have a question regarding a MousEvent, i have a small Graphics program where i draw some simple shapes and am using the MouseEvent for the beginning and end posistion. But it seem after using some System.out.println()'s that it is only picking up the mouseReleased when i go to the right and down, but nothing when i go to the left or up? I am appearently missing something or there is another method i can use instead?



thanks for any help in advance!!
Mike
12 years ago
Thanks everyone for your input!!


i will take a look at the java.awt.Desktop.browse(...). that Tim has mentioned .
12 years ago