Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Ralf Coby

Ranch Hand
+ Follow
since Jan 04, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
7
Received in last 30 days
3
Total given
28
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ralf Coby

Resolved.
I just forgot to push the "build"-button.
1 week ago
Hi community,

I've declared the dependencies below:



And this is my Websocket-Class:



But there is an error with my IDE.
I only can search in my IDE for the dependencies which depends to the annotations.
But my IDE doesnt get import-references.

So, i tried to import the library manually.


But it's not working.


I hope you can help me.

Thank you in advance
1 week ago
So, whatever. Can't help.

I have copied exactly the same sourcecode to a new java-project, and now it runs.

Whatever.

God moves in mysterious ways. Or something like that.
2 weeks ago
Edit:

The problem occured even with a single GUI.

I am at my wits end
2 weeks ago
Hi community!

I have several Guis which all depends on a main-gui.
If i choose "Clean and Build" in my Netbeans-IDE, and i try to execute the .jar-file, then nothing happens.

I guss, its because of the several guis.

My gui-code is like this:
Main-Gui:



second Gui:


Third Gui:




Thank you in advance
2 weeks ago
Resolved.

The problem occured because my 2 JFrames had the same identifier.
2 weeks ago
Additional to the last post:
I have figured out, that the NullPointer probably depends on my second window,

I have to Winodws with a menubar.
If i invoke the getters and setter-method with my first window, then everything is fine.
But if I invoke my getters and setters with my second window, which opens if I choose a subject in the menubar, then i get the NullPointer.
So I have to learn to implement a second window by choosing a subject of the menuebar.
2 weeks ago
sorry,

the last sourcecode is wrong.

But it's an average application with getters and setters.
2 weeks ago
Hi,

I get a NullPointer Exception if I click the button(awt) to tranfer a String from a JTextField.

This is Class "A" with the ActionListener:


An this is my application:

2 weeks ago
Hi,

yeah, in my case it's ok.
Because I only require like these 2 types of objects, which are in different streams.

So I define an object of type "Object" and then i cast it.
The program runs okay for my needs.
2 weeks ago

Campbell Ritchie wrote: Are your input streams of different types?



yes, thats right.

Now, i handle this in the following way:

For Example:
Client:
The first ObjectOutputStream writes an Object of type String.
The second ObjectOutputStream writes an Object of Integer.

Server:
So, the first InpuStream requires an Object of type String.
And the second InputStream requires an Object of type Integer.

I have solved it in that way:

if( ! (Object = First_Object_Stream.readObject() instanceof Integer)){

String str = (String)Object;

}else{

Integer i = (Integer)Object;

}
2 weeks ago
Yes.
At server side i worked with the "instanceof" or "!instanceof" to check if the InputStream reference is the required Object(because i have several objectstreams).
2 weeks ago
Hi community!

I wanna check if the ObjectInputstream is null or not.
If the ObjectOutputstream wants to send a null-object,  the InputStream shouldn't be invoked.

These is my code-example:

Client:



So if the string is "null" or the List<Byte>-Object is null, the OutputStream should not be invoked.

Server:


So, i wanna check if the 3. InputStream is null or not null.
If the 3. ObjectOutpuStream isn null (or the 3. ObjectInputStream gets a null-object) , the 3. ObjectInputStream should not be invoked.

Is there a solution?

Thank you very much in advance
2 weeks ago
Resolved. I've just forgot to press the "clean" button in my projects Folder.
Now, it doesn't work.

So, everything is fine.

Sorry for that thread.
3 weeks ago
Hi,
if i choose the AES Cipher with the CTR-Mode, then clientA is able to decrypt the clientBs encrypted text with another initialization vector.
But I have read in my book, that both sides (clientA and clientB) need the same initialization vector to encrypt a message in CTR-Mode.

So why is it working to decrypt a message with the same key but with different initialization vectors?


Thank you in advance
3 weeks ago