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
-
1
votes1
answer1169
viewsError Creating bean with name 'cargoDaoImpl': Lookup method Resolution failed; nested Exception is java.lang.Illegalstateexception:
I’m trying to move up my spring project but get the following error. 15:17:43.079 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []…
-
1
votes1
answer48
viewsThe tab is going through the reset button
I wanted the tab to stop just below the FREE THROW buttons, not at the bottom of the screen. How Do I Fix So Design Is Responsive? Because the content gets messy when the screen is in Landscape…
-
1
votes1
answer88
viewsMediaplayer.create() stops working after a few sounds
Hello, I put a different sound to touch each button pressed, but after 4 Tarts it simply stops. Code: numero = random.nextInt(numeros.length); MediaPlayer soundID = MediaPlayer.create(this,…
-
1
votes2
answers99
viewsImage Processing? Doubt on the subject and usability
You guys talk all right ? I have a doubt if that’s the same name of the theme Image Processing I don’t know if you’ve ever looked there are some apps that carry a proposal like this. There is a…
-
1
votes2
answers703
viewsHow to return the entity number of a table using JPA and the COUNT function?
I am using the Eclipselink implementation and cannot solve the following query that must be wrong: Query query = em.createQuery("SELECT e , COUNT(*) FROM Empregado e"); Integer resultado = (Integer)…
-
1
votes1
answer359
viewsVisitor counter using Spring Boot
I have a project of Mangas using Spring Boot with Angularjs and, I wanted to implement a counter of views, accesses, for each visualized manga. So I could classify the Manga in Category of most…
-
1
votes2
answers2457
viewsHow to use the controller in a java application
Staff I am starting in programming and would like to take a question that does not want to shut up, how to use the controller correctly whether it is being used in a design Pattern model or even in…
-
1
votes0
answers416
viewsCommunicate JS Node with java via socket
I would like to ask a question on how to communicate 2 servers, one being nodejs and the other being java. I would like to move information json between the 2 using socket support. I was able to…
-
1
votes1
answer55
viewsMerge POJO and Entity
I’m studying JPA and I need to serialize an entity: @Entity public class Employee { @Id private Integer id; ... } Is it good practice to serialize an entity directly like I do with a POJO? Or have…
javaasked 6 years ago ayowole agbedejobi 557 -
1
votes1
answer385
viewsHow to add a calendar in Frame or Panel in Java
I’m developing a Java project that deals with dates. The main idea is to put a medium-sized calendar on the main screen, dates that already have an event scheduled should have a color (blue, orange,…
-
1
votes1
answer67
viewsError in environment configuration
I’m using java JPA, with Wildfly and Primefaces and the database I’m using Mysql. I have all layers already configured (view(xhtml),DAO,Entity,MB). The wildfly datasouce is configured correctly,…
-
1
votes2
answers157
viewsMarker id pass to setOnInfoWindowClickListener
I’m trying to pass the value of the Marketer to the setOnInfoWindowClickListener, but I’m not sure what is the best way to do this, can anyone help me? It even passes a value, but not the loop, IE,…
-
1
votes0
answers38
viewsMVC Routes and Controllers architecture with multiple versions using Spark
I am implementing a Rest API in Java using the framework Spark. I need to split the routes into two versions or more: v1 and v2. I know the Spark provides the path(), I believe it is not difficult.…
-
1
votes2
answers742
viewsUse of Android Camera
Good afternoon, guys, I’m new here, so I’m sorry if I’m asking you something I’ve already talked about. Next we have an app in the company already a while ago for sdk 7, what happens is that…
-
1
votes1
answer661
viewsHow to change border color and Jframe title in Java?
I would like to know how to change the border and title color of a Java Jframe. I only found information on how to remove the border and title, but how to change the color not. I am currently using…
-
1
votes1
answer471
viewsError: cannot Convert from double to float
Why float is not accepted for numbers 0.197 and 0.185? Code: float salBruto, salLiquido; Scanner ent = new Scanner (System.in); System.out.println("Informe o seu salário:"); salBruto =…
-
1
votes2
answers351
viewsError returning Android Cursor
public boolean insertData( int id_item, String nome, int quantidade) { String preco_unitario = "0"; String id_pedido = "0"; SQLiteDatabase db = this.getWritableDatabase(); ContentValues…
-
1
votes2
answers108
viewsProblems with Casino Roulette
My programming teacher asked us to do a casino roulette that had the option of playing American, European and French roulette. But after some changes I made to the code when I type the name of the…
-
1
votes1
answer527
viewsUse Date Field in Java with Mysql
I’m having a little problem, I’m running a test using the data(Date) field in Java, and I’m having problems running. Below are the codes I’m using: 1º o Code to create table in Mysql Create table…
-
1
votes1
answer614
viewsJava project problems with CDI (Weld) + Hibernate + Primefaces
good night. I’m having trouble executing my project with the structure described in the title of this post. I am using Hibernate, with control of transactions by the server (JTA). Follows the…
-
1
votes1
answer181
viewsDarcula look and Feel in the application
Hello, I use Netbeans with the Darcula LAF graphical plugin to program Java. This plugin leaves a dark design, very cool. In the Jframe editing screen the look and Feel is inherited: But if I…
-
1
votes0
answers57
viewsphp_java extension does not work
Hello! I am having problems calling a java application in my php code, through the extension php_java: 1) I changed the configuration in php.ini, and the files are in the address described in the…
-
1
votes1
answer57
viewsListactivity error, probably related to Onitemclicklistener
I am having a problem understanding what is going wrong in this code, I feel that the problem may be related to Onitemclicklistener. When I try to emulate it responds with a message like this:…
-
1
votes1
answer221
viewsText encoding for RTF in java
I’m trying to modify a file .RTF, where the parameters that will be modified are settados as numbers. However, their characters are in ANSI believe me, because the file has its header the following…
-
1
votes1
answer57
viewsValue passed in Pattern tag keys for class name
I am studying about Logback to implement in my company’s system, and at tag pattern I have the following: [%d{yyyy-MM-dd HH:mm:ss.SSS}] %level [%thread] %class{0} %method %line - %message%n I…
-
1
votes1
answer57
viewsCan I get an image of any directory on my PC to put on my HTML page?
Can I get an image from any directory on my pc, or can I just grab images from the project directory? I am using JSF: h:graphicImage url="C:\teste\rcvp\18\04\20\16\372_180420160013_0000000_1.jpg"…
-
1
votes1
answer1846
viewsJava Academic System
Hello. I need help to build a Java program with the following specifications: 1) Read, from the user, the following items: Name(String), Age(int), gender(char[M or F]), telephone(String),…
-
1
votes1
answer82
viewsImplementation of the Life Cycle of an Activity
Hello. I am new to Android Development and would like to better understand how to build more robust applications for this platform. I understand how the life cycle of a Activity but wanted to…
-
1
votes1
answer210
viewsOperations in JPA
Good morning I am developing an application in which the user should inform the system a list of exams and the system display the laboratory units that perform such exams, however I am with a doubt…
-
1
votes1
answer172
viewsHow do I inject Ejbs that call other Ejbs into a Junit test class?
I’m trying to test a class in Junit. Turns out the class I’m testing has several Ejbs that call other Ejbs. How do I inject into a Junit EJB’s test class called other EJB’s? Thank you.…
-
1
votes1
answer219
viewsFile path cacerts for javax.net.ssl.trustStore does not work on . War
I need to set the path of a cacerts file to the trustStore, to do this I did: String keystore = "src/main/resources/cacerts"; System.setProperty("javax.net.ssl.trustStore", keystore); Running the…
-
1
votes2
answers716
viewsUsing java change method
How I change the database using the method changes in a Testaaltera class. I use the model gets and sets to change the data? I need to use the Search(int id) method to return an object? //pesquisa…
-
1
votes1
answer73
viewsMany logs with the message "setTypeface with style : 0"
I’m making a app in the android studio, and after spending a few activities the screen becomes black and the last record of the log cat is this message. I’ve looked at the other questions about it…
-
1
votes1
answer809
viewsHow to map an html page in Spring MVC
I have a Spring MVC project that will provide the Rest service to the front-end. But when creating a page . html the project does not recognize it and always from 404. Is there any configuration I…
-
1
votes1
answer2329
viewsJava creation of Register
I am creating an academic system in Java, but I have a problem. I have 4 classes (Principal, Pessoa, Aluno and Professor). I believe it is something simple, the error that appears is in the class…
-
1
votes1
answer254
viewsAdd empty item at the end of Listview
I have a FloatingActionButton in the lower right corner of my screen and when it comes to the end of ListView, it sits on top of a button. I would like to add an empty item at the end of the…
-
1
votes0
answers759
viewsReceive data from an Arduino sensor for the Android app ( Android Studio)
Good night! I need a help with the application I’m developing, I made the bluetooth connection of my Arduino with the android app and it’s all right, I can turn on and off small but I do not know…
-
1
votes2
answers104
viewsSending Servlet attributes to more than one JSP?
I have a Servlet that does the following: L_sessao.setAttribute("Login", usuario); response.sendRedirect("InicioCliente.jsp"); It sends the user name to the Homeclient.jsp page, on this page I can…
-
1
votes1
answer131
viewsMultiple @Elementcollection in two different classes @Embeddable
I have an entity with two classes Embedded of the same kind and each has a Elementcollection same type, too. Business logic seems to be correct, but I’m experiencing some problems with the lack of…
-
1
votes1
answer98
viewsPrinting a 3-in-3 formatted sequence of numbers separated by dash
Let’s say I have the following entry String S = "00-44 48 5555 8361" and that I need to return this character string divided 3 by 3, separated by "-", as follows: Output: 004-448-555-583-61 The…
-
1
votes1
answer5057
viewsEclipse - "The eclipse Executable Launcher was Unable to locate its Companion Shared library "
I already had the eclipse working normally (not used much) but now that I opened it appears this message when I try to run . exe : " The eclipse Executable Launcher was Unable to locate its…
-
1
votes2
answers126
viewsRelease of exceptions as a function of prime number
Write a function that receives a number, throw an exception if the number is not positive and return true if it is prime, or false, otherwise. My answer: public static void main(String []args)…
-
1
votes4
answers66
viewsAdd 0 to the left in an Arraylist <Integer>
Hello, this code returns 6 values between 1 and 60 without repeating and in order. But for numbers smaller than 10 I would like to add 0 before type: 01,02...10. I tried using String.format() but it…
javaasked 5 years, 11 months ago Murillo Comino 1,133 -
1
votes3
answers344
viewsDetermine the page where the *.pdf file will open in the browser
I have a code to display a pdf file: @WebServlet(urlPatterns = {"/teste"}) public class abrirPDF extends HttpServlet { byte[] arquivo = null; File file = new File("C:\\testes\\teste.pdf"); protected…
-
1
votes1
answer670
viewsUnable to instantiate Activity Componentinfo; java.lang.Illegalstateexception: System services not available to Activities before onCreate()
I have a project of a chat socket running in Swing and now I’m passing it to Android. Everything was working perfectly until I put in the code that makes the magic happen. The application closed and…
-
1
votes1
answer61
viewsHow to call another Activity/Canvas with Java in Totalcross?
I am developing an application with java through a tool called Totalcross and I need to call another screen/actividy but I do not know what code to do this. In android would be the equivalent of…
-
1
votes2
answers43
viewsApp Closes when installing when I will test
I am a beginner and already in my first tutorial I have this mistake I did the whole process as it is in the video tutorial, and when I try to test it on my phone, it compiles, installs, opens and…
-
1
votes0
answers51
viewsValidate String Regular Expression - Java
Hello, I would like to validate a String in java received from an INPUT. This validation would be to determine whether the user actually typed a valid email in the following pattern:…
-
1
votes1
answer620
viewsHow to use foreach to print information from an object array? (Java)
Good night! I have this structure below and would like to know how I could use a for each to print the information of this vector. public static void main(String[] args) { Scanner teclado = new…
javaasked 8 years, 1 month ago Lucas Medeiros 13 -
1
votes0
answers67
viewsProblem to update data
Good morning friends, I am about 3 days with difficulties in an error that has been occurring in my application. I have two entities, CUSTOMER and VEI. I did the mapping bidirectionally saying that…