Pan Niko

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

Recent posts by Pan Niko

Hello,

I'm trying to create a SealedObject that contains a Serializable object and a cipher that initialise with RSA. I want to create a pair of keys for each user, so that's why I'm using RSA. I'm getting an Exception when trying to encrypt this object and I know that the reason is because key's size. My question is how I can create a SealedObject that will contains an Object[] (with two integers and a SecretKey) and encrypt it using user's public key?

Thanks in advance,
toto_7
13 years ago
Ok, I believe is better to stick to current way, because I don't want to mess with new libs. So for example I have a file like this .. link. As you can see contains a lot of <step>. So I want to retrieve from each <step> the <start_location>/<lat>,<lng> and <end_location>/<lat>,<lng>. How I will be able to do that on API 7? For each route the <step> element vary...

Thanks in advance,
toto_7
13 years ago
That's cool thanks for quick reply. There is a problem however. Cause I'm working on Android API 7 and need to stick on that API, I can't use XPath stuff. There is any way to make it work on API 7 or there is an alternative way using SAX Parser?

Thanks in advance,
toto_7
13 years ago
Hello,

I didn't use XML files for a very long time and I have forgot how to interact with complicate files. Need to retrieve the value of an Element in an XML file that is sitting too deep in that. For example:

I want to retrieve the latitude value that appears here: DirectionsResponse/route/leg/step/start_location/lat. Need to do the same for Longitude and latitude/Longitude for the end_location. "leg" contains more elements but I want just "step". Also, "step" elements are not always the same quantity, so need to check the size of the "leg" or how many "step" contains. I made some tries but all have failed! Please anybody knows how my for loop should be in order to getting correctly all "start_location" and "end_location" from all "step"?


Thanks in advance,
toto_7
13 years ago
Hello,

Thanks for responses. With code above wanted to add different arrows around a board. That's why I was using North, South, Page End and Start. Figured out how to do it and are simply two things. First, use West and East instead of Page End - Start and second panel's layout to be BoxLayout(), with Y_Axis or X_Axis.

Thank you, again
13 years ago
Yes but, I'm creating new Panel each time and also has different position for each condition(North, South, Page Start, Page End). Also, I have right and left be Page Start and Page End, then why place them North and South ? :S Really weird
13 years ago
Hello,

I have really stuck at this point. I have the code below:

The output is as shown below :

HERE

You can imagine from my code that is not the result I want! So, what I'm doing wrong? Any idea?

Thank you
13 years ago
Ok thanks all of you for you response. Tried something like



At first didn't work, re-open eclipse and everything was fine!! Don't know the reason.

Now because I'm working first time with setActionCommand(String); I would like to know, if you have an array of JButton, you should create setActionComman(String); and addActionListener(listener) for each button individually? There is an simpler way?
13 years ago
Hello,

Is the first time where trying to use inner class, so occurring some obstacles. I have an inner class that extends JButton and has getters and setters for X and Y (coord.) . So how and where, can I in my outer class create and initialise an array of inner class?

Thank you
13 years ago
Hello,

I would like to ask if is possible to use an object that created in main method to the constructor of a class. Or if there is way to do that, to share the same object main method and constructor.

Thank you
13 years ago
Hello,

Finally, decided to have one controller per each view class I have, and also, implements my view classes to Observer and my model class to Observable. By using interfaces with the way I'm working, is still helpful?
13 years ago
Thank you so much about the code, helps a lot. Need to have for each button I have in my program, or is multi-usable with this way? Also, if I have an empty JTextField in the ViewImpl and a button, and want when button pressed the JTextField filled with "Hello", how I will do this using MVC?

thank you

** Didn't notice this before, sorry


What is contained in those classes View and Model where you implement these classes?
13 years ago
Hello,

I trying to implement a program that is based on MVC model. Is my first time and I'll like some help. I have few classes that contains JButtons, JLabels, etc. those are my View. Also, I have a class that implements ActionListener and MouseListener and my View classes extends this Controller class. So, my obstacle is how I will connect each button or label in every class to this Controller class, so when button pressed to do something? Need a small sample code please.


Thank you
Pan_Niko
13 years ago
Hello,

I'm new in this kind of architecture and I'm finding some obstacles. I have a project with 3 classes. The goal is to take a list of names from an input file and store them in two other files according their status(Pass or non-Pass). Pass, is an input where has a specific ID and one of two(or both two) specific numbers. Also, if an input doesn't has the specific ID but has a specific 3rd number and one of two specific numbers above then is Pass too.

For example:
specific ID=xxxx - specificNum#1=1234 - specificNum#2=5678 - specificNum#3=9999
input#1: xxxx - 1234 - 0000 -->Pass
input#2: xxxx - 3333 - 0000 -->non-Pass
input#3: xxxx - 1234 - 5678 -->Pass
input#4: zzzz - 1234 - 0000 -->non-Pass
input#5: aaaa - 1234 - 9999 -->Pass
etc.

So my main class scanning the input line and searching for the specific ID. Second class taking the line and searching for specific number. Third class taking the line and writing it to the appropriate text file.

In main class also created three objects of 2nd class, each one has different searching numbers and two 3rd class, pass and non-pass

My first question is, I have to create another 2nd class that will doing different things that current does, or I can solve it with just 3 classes?

Thank you,
Pan Niko
13 years ago
Hello,

I did't use sounds in my programs before, so i'm completly new on this. I'm using the structure below



I have problem with AudioStream type, underline it and says "Access restriction: The type AudioStream is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar"

What is the problem. Also, there is any other way to insert sounds in the program?
13 years ago