Category "java"

List View Constrain jump to top

I am trying to learn SQL database with a tutorial. I add user and age to database and get them back and displayed using listView using ViewAll button then if

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause

Get pixels of a recyclerView item

I'm wondering if it's possible to get the pixels of an item of a recyclerView, let's say I have an horizontal recyclerView and all the items are the same size (

How to deserialize this dynamic keys JSON to Java custom Pojo using Jackson

I have a pretty complex json string that I would like to deserialize into custom Java Pojo, but Im not so sure how to do it. Here is the json: { "A": {

Show screen before another app starts in android studio

I'm doing an app that blocks the access to another apps when you have used them for an specific time, for example Facebook. So, my idea is to show a screen when

Hibernate XML Entity Mapping

I have simple definition of my entities, but what i do wrong, because i can not get any entity UserInfo and receive only error (could not load an entity: [UserI

One JList/JCheckBox combination not working

I am doing an exercise in a book where you have to test event handling. I have a JList with 3 font choices (Serif, SansSerif, and Monospaced) and two checkboxe

How to encode the GWT Long value in RPC Request

I am using JMeter to generate random number for load test Q) How to encode the long value below "DI"? The original value is 200. 7|0|8|http://10.6.3.1:90/portal

Java - How to replace entire 2D ArrayList with another that has different size

I have 2D ArrayList consisting of Objects, i pass it to a function in another class, like this: public void function(ArrayList<ArrayList<Object>>)..

Every bean/class instance created twice in spring boot application

I'm using java based configuration, using only @Component and @Scheduler Annotation in my other classes, but I don't know why all classes in class path loaded t

Parse JSON Array from an api in java

I have an api that gives me this json array. How do i just get specific key value pairs for traceId? these are traces generated by zipkin but i want to store th

Modeling a 4x4 Grid for Simple Game Using Looped ArrayLists in Java

I am meant to create a game in Java that specifically uses looping Arraylists to create a 4x4 grid. I have a Grid class, made up of an ArrayList of 4 Rows, a Ro

How to convert KML to GeoJSON using GeoTools in Java (GeoServer don't accept the result of my conversion)

I have a KML File and I need convert to GeoJSON. I am using Geotools in Java for convert KML because GeoServer has problems to import KML. I can convert the fil

JavaFX Maven shaded jar fails to open on double click but can run from terminal

This is the Maven shaded plugin I'm using in my pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>mav

Why am I getting this error unexpected type required: variable, found: value in my method?

I am trying to update my account balance. I have a getAccountBalance accessor in my Account class in the same file as my main method, my main method has the Acc

WebFlux async responses from controllers

Hello everyone My task is to simply make controller that gives me results immediately when they are ready (simple example below) Imagine: I want to get the exac

Map database record to entity without knowing its id

Basically I have the system where there is entity called Dictionary, where all dictionary entries are stored (like countries in example below), these entries ar

Take a class as a parameter which has a particular method in it

I know that we can pass a class in a param which has a particular class as its super. For example, see this: public void sampleMethod(Class<? super MyParentC

When calling javax.imageio.ImageIO.read, can I specify the format?

In Java, I want to use the class javax.imageio.ImageIO to read a image from an InputStream. This class has a static method, read(InputStream input), which can d

Excluding @bean from ComponentScan

I have lot of beans declared in a single class package com.example; @Configuration public class MainBeanClass{ @Override @Bean("cachingSession") @Lazy public C