Skip to content
Advertisement

Tag: java

Java Implementing a Client Server Model (Using TCP) and sending a IP address from server and Printing it out on Client

Server code: Client code: Error: Server side: Exception in thread “main” java.lang.NumberFormatException: For input string: “ip” at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.base/java.lang.Integer.parseInt(Integer.java:660) at java.base/java.lang.Byte.parseByte(Byte.java:193) at java.base/java.lang.Byte.parseByte(Byte.java:219) at exp1/exp1.MyServerSocket.main([MyServerSocket.java:14](https://MyServerSocket.java:1 I’m trying to display the localhost’s ip on client but I get an error. Answer getHostAddress returns a string representation of an address. So, this method returns something like 192.168.1.100 which can’t be parsed

unchecked call to setValueFactory(SpinnerValueFactory)

I’m using Java JDK 17, and I get an unchecked call warning for the following code snippet: Error unchecked call to setValueFactory(SpinnerValueFactory) Code How can I get rid of this warning. Answer Your problem is in the code you don’t provide, for these kinds of issues you should always try to provide a minimal example. I have made an assumption

Persist dark theme setting and apply in vaadin 14

Hello I want to apply the dark theme at the login of the user in Vaadin 14. But it does not work when i call the toggle function programmatically. I was following this example: https://vaadin.com/learn/tutorials/toggle-dark-theme The setting is already persisted, but how can i apply the theme setting? It works only when the trigger comes from a request thread. Here

How to split string of mulitdimensional array

i have string here String str1 = “{{1,2,3},{4,5,6},{7,8,9}}” and the result i expect is like this what method i use in java language? Thanks. i tried with split method then put each array into an arraylist variable “data”. result : and try to delete the data array that is empty and which only has a string value”,” result : and

JSoup not able to get links from html

I’m trying to get links from html of a site but unable to do so using Jsoup. This is the HTML: This is the android code that I wrote which doesn’t seem to work: Can someone please help me with this? Thanks Edit: Basically I’m trying to get those 6 links and add them to my list to use it

Advertisement