Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
0
votes1
answer85
viewsAccessing another APP within mine with Oauth 2.0
How to use Oauth 2.0 to change Apps. I have some Apps and I want that within it we can access other Apps (from the same provider), without having to login again.
-
0
votes1
answer151
viewsRotate an image that is in an array
Good afternoon, I have a color image in an array 1D, for example: int[] image = {255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0}; This array has 6 pixels, red, green, blue, blue,…
-
0
votes0
answers80
viewsWhen I run Update the eclipse for execution
When arriving at the part that executes the following query the system stops and does not proceed to the next line. @Query(value = " UPDATE COOBILING_NUMBER SET CONDITION='Used' WHERE NUMBER_PHONE=…
-
0
votes1
answer776
viewsHow to view HTML elements in an Android Textview?
I am developing an Api that returns some texts, but these texts have tag HTML, is bold <b> or line <P> would like to know what would be the best way to print this in a TextView, or if I…
-
0
votes1
answer180
viewsSearch Data in a Listview with Arrayadapter
I have a listview with Jsontask to search in my database is everything OK. In this listview I have several fields, Plate, Brand, Model, Year. etc. I saw some examples on the net but it is for simple…
-
0
votes1
answer411
viewsWhat is the difference between parameterized class, multiobjects and Collections?
Well, I know the concepts of each one. I just don’t know how to tell them apart. For example, a parameterized class is a class that is used to define other classes, and a Collection can be…
-
0
votes1
answer38
views -
0
votes1
answer546
viewsList two related tables Primefaces x Hibernate
I need to list information from the two tables on the same grid, they have relationship created by Ibernate itself. You would need the vendor name in the table shown below In case it would be these…
-
0
votes1
answer98
viewsSubproject dependency injection . jar
I have an app EJB who owns a lib jar as a dependency built for code reuse. My . jar has a class that has been annotated with @RequestScoped, and I need to retrieve it on my ejb. I’m using the…
-
0
votes1
answer202
viewsWhy does the primefaces dataScroller stop fetching records?
My xhtml is like this: <p:dataScroller ajax="true" id="listaDiarios" chunkSize="3" lazy="true" value="#{managedBeanUsuario.lazyRegistrosDiarios}"…
-
0
votes1
answer344
viewsWhat is the difference between domain logic and application logic?
How do I know whether to put the method in the class itself or in the class BO? When to know the difference of domain logic and application logic? Note: I was left with the doubt after read this…
-
0
votes1
answer42
viewsFriendlychat - date in messages
I implemented in my Android Studio project the Friendlychat available in codelab. But there’s no date and time in the messages. How to Implement the Date and Time in this Project? In this link are…
-
0
votes0
answers133
viewsRetrieve data from Object[]?
In the Debugger I saw that the object receives ['product', 210] Object obj = prodRepositorio.somaById(); I’d like to get the data on it but it doesn’t work cast or anything. I’ve tried to String…
-
0
votes1
answer65
viewsUpdate Variable - SQL Database - Hibernate
here are excerpts from my attempt to create a real estate registration software and users. The project was developed in the MVC structure. (Model, Visualization and Control. Problem: How to update…
-
0
votes0
answers101
viewsVersion identification in Web projects
Working with Webservices on several glassfish servers, and currently the version identification is done in the file . War, example: test-1.0. War I wonder if this is the right way, or what would be…
-
0
votes1
answer18
viewsHow to configure the mvc resoures tag without xml
Good night. I’m trying to configure the annotation of xml without, according to the code below, to add my js/css pages inside, but I’m not getting it. public class Appwebconfiguration { @Bean public…
-
0
votes0
answers34
viewsDoubt with Generics in Java
I have a class that uses generic type public abstract class AbstractDAO <T extends Entidade>{ //corpo da classe } At some point I need to know the class of T, the compiler does not accept to…
-
0
votes1
answer324
viewsHow to open new Activity by clicking on the child element in Expandablelistview?
I wonder if it is possible to open a new Activity by clicking on a child element of a ExpandableListView, keeping in mind that for each child item element open a specific Activity? My layout…
-
0
votes1
answer81
viewsI can’t get value from my form
I created this form and I can’t redeem its values in Bean. Follows form and parts of the bean. Form <h:form id="form"> <p:commandButton value="Salvar" icon="ui-icon-document"…
-
0
votes1
answer76
viewsDoubt with algorithm and vector
help me solve the following algorithm. In this case, it is a vector of 20 positions. My doubt is what values would be stored in vector A? for (i=1, A[0]=1; i< A.lenght; i++) A[i] = A[i-1]*2;…
-
0
votes2
answers2574
viewsException in thread "Javafx Application Thread" open FXML inside an Anchorpane
I created a top Menu and want to open the corresponding FXML file inside Anchorpane when I click on a menu item. But it has made the following mistake: Exception in thread "Javafx Application…
-
0
votes1
answer215
viewsHow to configure log4j in a java project that does not have the src folder?
I have a Java project that does not have the src(8z !) folder and I need to use log4j, I created the log4j.properties file and inserted it into the main package (com.meuproj.main), but the log file…
-
0
votes0
answers683
viewsPOI apache, Function if you have the value in a blank cell
I need a little help with the use of apache POI, in my application I need to perform a query inside a spreadsheet, this query checks if there is a value in the spreadsheet, this query is ok, below I…
-
0
votes1
answer444
viewsSearch using two parameters in JPA
Good night to you all, I am stuck here in a logic, I did the DAO for all the CRUD of my project only that in it will not only have the search for the ID and I am also trying to do some method that…
-
0
votes1
answer437
viewsHow to iterate over a stream from a list that has an array and return if true?
How do I get the Enum object with an ID I passed as parameter check an Enum object element if true? My builder: private WeaponInterface(int[] weaponId, int speed, FightType[] fightType) {…
-
0
votes1
answer175
viewsIllegalargumentexception: illegal value in JPA when recovering Jspinner value
I’m testing an event on a JTable of the kind tableMouseClicked(evt), only that I am having some errors when returning the values in the respective Jtextfield and in a Jspinner that I configured.…
-
0
votes1
answer85
viewsHelp on a JPA query
I’m trying to make a query using JPA criteria, it would be as follows: I will pass 2 Start date and a Final Date and a vehicle plate how can I make this query? NOTE: The table that I will consult…
-
0
votes1
answer162
viewsinverse java Sort shell
personal I’m having a doubt, how to make descending reverse Sort shell. private static void shellsort(int v[], int n) { int i, j, aux, h = 1; do h = 3 * h + 1; while (h < n); do { h /= 3; for (i…
-
0
votes1
answer2523
viewsJsonformat changing date on a get request
I have a java web service using Spring Boot, in a class I have a date attribute and I use Jsonformat to format the date and convert on the client side using Gson. However, even defining the locale…
-
0
votes1
answer548
viewsHow to change Activity by clicking on an option in the Alertdialog menu?
I have the following problem, I have a method that is called, when one clicks on a button, AND HOLD, (onLongClickListener) will appear an Alert with several options. 1st Option is Cancel the Table,…
-
0
votes1
answer197
viewserror: class,interface, or Enum expected?
So guys were here trying to do an exercise of old game in android studio and I can not find where is the error, I would like some help. package com.example.francisco.jogodavelha; import…
-
0
votes1
answer143
viewsWhat better way to connect to a Web server using Java Web?
I am working with a Java Web application, which will constantly take a txt file, and update this data constantly in an HTML page, but I don’t know what is the best option to connect to a web server,…
-
0
votes0
answers32
viewsRxjava receiving the data
How to separate this array into 3 arrays, like one for gradesList, one for faultList and one for classList. To use Rxjava. [Gradelist(gradesList=4.5, faultList=5, classList=Math),…
-
0
votes2
answers848
viewsSpring-Boot + Thymeleaf, load data into Bootstrap modal window
Good afternoon! I am using spring-boot and Thymeleaf to develop a java application, I would like to know how to load records to the modal window of bootstrap by clicking on the link of the table…
-
0
votes0
answers204
views(JAXB) Recover XML file in the input fields of a Jswing form with Unmarshalling
I am new and I started to learn these XML days because of an implementation that should have in my application, I did some tests with Mashall and unmarshall in the main class first (see at the end)…
-
0
votes0
answers51
viewsUse of framework in java web project
I have a java project that runs services (SOAP/REST) and we have a framework that supports this, generates report, makes REST calls and so on, and I also have a java web project (Javaee) that…
-
0
votes1
answer31
viewsInstance error for class
Good afternoon, I’ve looked at it many times and I don’t understand why it’s wrong. I need to instantiate the "created variable" that is in Jframe for the User class. But it keeps saying that on the…
-
0
votes1
answer104
viewsTaking Values from a range of numbers where the tens n repeat
I would like a way to solve a problem that consists in reading 2 user numbers that will be my start and end ex 10 and 50 and within that range do not show the repeated numbers ex 11,22,33,44.
-
0
votes1
answer87
views@Jointable or @Joincolumn
Good afternoon, you guys I have a diagram as below and I have a question. It is between User and Account and what I am in doubt is, if I access by ACCOUNT, I find the USER, but I can not do the…
-
0
votes0
answers120
viewsXstream library generating xml with empty node
I’m using the library Xstream 1.4.8 with the following XML: <root> <att1>1</att1> <att2>2</att2> <nodeB…
-
0
votes1
answer38
viewsDoubt about getSource() instanceof
Instanceof is a binary operator that tests whether an object is the subtype of a certain type. Ex: Object fonte = e.getSource(); if (fonte instanceof JButton){ ... } If getSource() returned…
-
0
votes1
answer319
viewsRun class when starting web application
I have a class that would need to run along with the web application every time it starts. I would upload the application to the server and this class would need to be run. This application is…
-
0
votes2
answers441
viewsWhat does this piece of code mean?
Recently I came across a stone in the shoe, I was going to comment on a code, but I realized I was filling sausage when commenting on it, because I do not know what is the actual use of the code…
-
0
votes1
answer567
viewsRunning a java applet in the browser
Well, I made a program in applet, (extending the Japplet class) and generated the file . jar, put it in a folder and wrote an HTML page to run it: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0…
-
0
votes1
answer84
viewsError with setOnTouchListener
Eae, I’ve been getting the second error while running an app on Androidstudio /AndroidRuntime: FATAL EXCEPTION: main Process: com.example.vinicius.login, PID: 3519 java.lang.RuntimeException: Unable…
-
0
votes1
answer336
viewsDevice incompatible with Play Store app
Some devices, especially a tablet is unable to download an app from the play store. Can anyone tell you what might be blocking? <?xml version="1.0" encoding="utf-8"?> <manifest…
-
0
votes1
answer52
viewsJradiobutton and Jbutton
Good afternoon, you guys! Gentlemen, I’m developing a small application, which is a file converter for personal use here at the company and I’m faced with a question that may sound dumb, but I…
javaasked 8 years, 10 months ago José Allison 229 -
0
votes0
answers35
viewsHow to pass selected item between Activities
At the moment, I am doubtful to make the item clicked on that screen http://prntscr.com/eyjdzo appears selected on that screen http://prntscr.com/eyjecw…
-
0
votes0
answers32
viewsHow to check if my table has related records?
I am developing a project using JPA and with various relationship types like Onetomany, Manytomany, etc. Is there any way I can check if an X table for example has related records in another Y table…
-
0
votes1
answer106
viewsWhy is the description variable leaving null?
I don’t understand why the variable descricao not producing the values. In this case, it should go out like this: Old charger connecting two-pin connector socket But it’s coming off: Old charger…