Questions tagged [java]

Lô đề online Java is a popular high-level programming language. Use this tag when you're having problems using or understanding the language itself. This tag is rarely used alone and is most often used in conjunction with [spring], [spring-boot], [jakarta-ee], [android], [javafx], [gradle] and [maven].

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

LookAndFeel blocking JComboBox background change?

The goal is to change the background of all combo box when LookAndFeel is in the main method. But I get different results when LookAndFeel exists and not. Without LookAndFeel: JComboBox is visible ...
0
votes
0answers
6 views

How to avoid the maximum Datawatcher id of 31? Minecraft 1.7.2

I'm making a mod that need to use about of 25 datawatcher's id's. But there is a limit of 31 maximum value. How can i handle it? I tried to add a new type of datawatcher object - a double array that ...
-3
votes
1answer
19 views

Unique id generator unit test

I have implemented a unique id generator in JAVA and I'm wondering what could be meaningful unit test cases to cover it.
-8
votes
0answers
18 views

Write a java program that takes an integer input and prints an output messages stating whether or not the user enters an odd positive number [closed]

Write a program that takes an integer input and prints an output messages stating whether or not the user enters an odd positive number.
0
votes
0answers
20 views

how to add char values to char array in java

I'm trying to put the complement results from a char into a char array complement1. I thought I can use the operator but that's only for strings but I'm having a hard time trying to figure out how to ...
0
votes
0answers
9 views

JpaRepository find by manyToMany attribute

Let's imagine classic example of manyToMany relation. I have entities Student and Course and manyToMany relation table between those two entities. @Entity data class Student( @Id val id: UUID, val ...
0
votes
0answers
11 views

Camera opens 2 times and crashes

I am just new here because I actually need help with an error in my CamActivity.java. When I open the app, the camera immediately opens, I click the button, the camera opens again. But as soon as I ...
0
votes
0answers
6 views

assertThatThrownBy() check field on custom exception

How can I check particular field value in my custom excepiton using assertJ? Here is exception class: public class SomeException extends RuntimeException { private final Set<Integer> ...
0
votes
0answers
4 views

Imageloader Only Loading One Image

I have been trying to figure this out for some time. Imageloader is only loading one image correctly and showing the default image for everything else. This happens both on the emulator and my ...
-5
votes
0answers
15 views

java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException: Attempt to invoke

if ((ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) && (ContextCompat....
0
votes
0answers
9 views

Are AnonPages part of the heap? What are they?

AnonPages: Non-file backed pages mapped into userspace page tables Is all I find online. Does anyone know more?
0
votes
0answers
5 views

getting the [DuplicatePlatformClasses] when I try to build the APK version .seams like the problem comes from opencsv library

so I finnished writing an app after a long time and when I went to Build the APK version of the app ,it gave me a [DuplicatePlatformClasses] error ,since the last time it didnt give me any errors ,I ...
0
votes
0answers
11 views

Apache HttpClient: Correct Way to Measure Response Time

I'm trying to measure the server response time using the Apache HttpClient. I have set up the test code below. I assume that tp3 shows the (send-to-receive) time. According to Google chrome the ...
1
vote
2answers
30 views

Re-hashing a hash map inside put method

I'm trying to implement a separate-chaining hash map in Java. Inside the put()-method I want to re-hash the map if the load factor( nr-of-elements/size-of-array) gets to large. For this I have written ...
0
votes
0answers
6 views

How to select the nearest agent connected through another agent in a network in AnyLogic?

In a model I have connected different agent types in a network through 'link to other agents' objects. Let's assume the red agent types are factories, yellow represent shops, and green represent ...

15 30 50 per page
1
2 3 4 5
115036