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
answer191
viewsHow do I add values to an array?
Well...I know how to add values to an array. Actually, that’s not quite it. I have been learning java for a short time and started working with netbeans. The teacher asked for an activity to create…
-
0
votes0
answers211
viewsProblem with hibernation and JPA
It’s a WS REST, he should return a donor, but he’s making an exception... Console: set 22, 2016 3:37:15 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.0.1.Final} set 22, 2016…
-
0
votes1
answer1273
viewsKnow if Activity is open (Broadcastreceiver or service)
I would like to implement a function that can check if Activity is open, because when I receive the notification through GCM (Google Cloud Messaging) if Activity has opened will only upload the…
-
0
votes1
answer6742
viewsIs there any way to generate a random number between two numbers in Java?
How do you generate a random number in the specific java between min and max? Because with the nextInt function of the Random class you can only specify max.
-
0
votes1
answer29
viewsDoubt technology for building Webapi Rest in Java
I am posting this topic to check from your experience which technology you are using to build Webapi Rest in java. What libraries? What techniques? What advantages and disadvantages of technology. I…
-
0
votes1
answer406
viewsplace name in columns from an object array
public class TableModelAgendamento extends AbstractTableModel { int contador = 1; int qtdFuncionario; private TOFuncionario[] func = new TOFuncionario[qtdFuncionario]; String coluna[] = new…
-
0
votes1
answer175
views -
0
votes0
answers58
viewsDoubts of modularization of classes
I am developing an application for didactic purposes, end of semester college work, in this will do CRUD of the disciplines in a table in the bank already created, "DISCIPLINES", I thought about…
-
0
votes1
answer46
viewsNullpointerexception when query in Sqlite
I have a problem that is seriously damaging the development of my application. It aims to draw a question (not implemented yet, I’m using a fixed value for the question id) through a query in…
-
0
votes1
answer365
viewsInsertion Sort (Sorting by insertion)
Could someone give me examples of everyday life in which the method of ordering by insertion is used? Note: Without being ordering cards
-
0
votes0
answers94
viewsException in thread "main" java.lang.Nullpointerexception after it runs the first time
exercicio02.CaracterSort.buscarJogador(CaracterSort.java:116) at exercicio02.CaracterSort.cadastro(CaracterSort.java:110) at exercicio02.CaracterSort.main(CaracterSort.java:39) When I run the code…
-
0
votes2
answers110
viewsAccess JAVA web application from other machines
I am using JAVA,JPA, with Wildfly,e primefaces. I have the link of my application http://localhost:8080/Sicoob/faces/cadastre I would like other machines to access this application, I already…
-
0
votes1
answer715
viewsJava data input and output and data processing
I have a huge list of exercises and I only have these two to do last but I can’t do it at all. This I/O thing didn’t get in my head! Make a program that reads a text file, named "input.txt",…
-
0
votes1
answer474
viewsJava Framework for Ecommerce-style Website
good night! I would like the opinion of those who are active on which is the most suitable framework for developing a site in the E-commerce style using java. I was thinking about JSF 2 + Primefaces…
-
0
votes1
answer496
viewsproblems running createNativeQuery
Hello, everyone. I am creating a project that handles user registration. In this project there will be several types of users. To simplify, let’s call the types 1, 2 and 3. Depending on the type of…
-
0
votes0
answers191
viewsRun audio on an Android Webview
How do I execute audio from a url using a Webview in this case a radio URL, follow the code below. WebView mWebView; mWebView = (WebView)findViewById(R.id.webview); WebSettings webSettings =…
-
0
votes2
answers488
viewsWhen should I create a class?
I know it sounds like a really silly question, but I’m starting now in the world of programming (focused on mobile). When I create an app it gets all the functions within the Activities, then I…
-
0
votes1
answer76
viewsHibernate returns many queries and overwrites my changes
Good afternoon guys, I am trying to make a change in a datatable, when clicking on rowEditor, the value is sent correctly, however, I do not know why, It is being held many queries with Hibernate. I…
-
0
votes1
answer190
viewsI cannot fix this java.lang.Nullpointerexception error
I am creating a simple app to show the images in a kind of gallery but I am unable to show the images in the view by Adapter. Always give this error Nullpointerexception Adapter class: public class…
-
0
votes1
answer126
viewsError in Change - Java and Mysql method
Java masters, I’m working on a college project, using MVC layers, and I’m having trouble with the alterarClient method. When I click the Change button on the form, it sends a message saying that the…
-
0
votes2
answers1014
viewsHow to solve the cannot find Symbol variable problem?
I am trying to upload an image in android studio but I have a problem that appears an error cannot find Symbol variable in RESULT_LOAD_IMAGE someone knows why this error my code goes below: Click…
-
0
votes1
answer138
viewsphp undefinex index
index.html Customer Registration <!-- Bootstrap --> <link rel="stylesheet" href="css/bootstrap.css"> </head> <nav class="navbar-default navbar navbar col-lg-12"> <div…
-
0
votes1
answer129
viewsHibernate with dynamic table names
Good Morning/Afternoon/Evening Staff! in a scenario where a comic table must have a concatenated name and dates as this would look with Hibernate given that the base name is annotated in the model.…
-
0
votes1
answer50
viewsDoubt the JAVA and Tomcat Server application
Guys, I need a help. I have a server application in JAVA EE and accurate using Tomcat to upload this application to use it in another application. How can I do that?
-
0
votes1
answer2375
viewsDynamic Table Paging with Angularjs
I have the following scenario: I recover this data from a Rest API with Vraptor. I would like to display only two items per page, but I don’t know where to start. I implemented this pagination using…
-
0
votes0
answers120
viewsOutdated data in Hibernate + JPA queries
I noticed a problem in my Spring application, I am implementing an internal messaging service and when creating the display of the amount of unread messages I realized that the value varied with…
-
0
votes1
answer444
viewssort the dates in the bank
I’m having the following problem, I can’t sort in ascending order the dates that are saved in the bank, I’m using order by no select but just sort the first two houses until I get to / causing the…
-
0
votes1
answer71
viewsBlocking any other application via Service
Speak guys, I’m creating a business application and I need to block any other application that the user tries to open. I’m creating a service for it, but it’s not working. When executed, it does not…
-
0
votes1
answer315
viewsHow to create table relationship in mysql
I’m starting with a relational database and I have difficulty relating the tables, I’m a layman. I ask for help by indicating a/some clear and objective books on the subject. Grateful for the…
-
0
votes2
answers854
viewsPut default value in column
I need to leave a default value in this table column, I am mapping the Persistances with Hibernate (summarizing the database is created according to the HQL/JPA I define in Omains. How do I set a…
-
0
votes1
answer695
viewsRun Java program with PHP and return Console Output
I need to run a Java program that is on my server, for example Teste.java and return the console output resulting from the execution, either an error, or a phrase like Olá Mundo!, using PHP. I’ve…
-
0
votes2
answers60
viewsHow to search the bank with three types of user?
Hello I’m doing a college project, it’s an internship site project, it has to be developed in Java WEB with database. It has three types of user, the student, the company and the administrator. I…
-
0
votes1
answer103
viewsConnection problems with Postgresql(ghost URL)
I am working on a web java project and have a connection class with the Postgresql database ,which connects the database called BASE_X which performed well, but I made a copy of the project that has…
-
0
votes1
answer94
viewsWhat’s wrong with running Hibernate Query?
I am running this query in Hibernate: manager.createQuery("from Usuario where senha = '" + senha + "' and login = '" + login + "'", Usuario.class).getResultList(); But is giving an Exception that…
-
0
votes1
answer486
viewsSeveral errors when compiling in Android Studio
I created a project in Android Studio (yes, the Rootear device). I finished the main screen and created the action for the Root button. Pórem, after I created a screen of "Welcome" came up several…
-
0
votes1
answer156
viewsHow to know if the Cpf field does not exist in the database?
Example of what I’m trying to do: vRS = sql.executeQuery(); while(vRS.next()) { nome = vRS.getString("nome"); cargo = vRS.getString("cargo"); } What I want to do is when the record does not exist to…
-
0
votes1
answer92
viewsJDK tools.jar
I am using the tools.jar of the JDK (more specifically Attach) in an application, however, according to my research the tools.jar cannot run in a JRE environment "because it depends on the JDK". Is…
-
0
votes1
answer174
viewsHow to read this XML and ignore the ID field using Xstream
I need to read the XML below and ignore the ID field of all contacts <contatos> <contato> <Id>1</Id> <Nome>Madeline Mullins</Nome> <Telefone>(22)…
-
0
votes2
answers194
viewsNullpointerexception error using Boolean type
I’m having problems again with this project, the application runs normally opens the screen to register and everything, but when you click on the button to save it simply closes the app, but the…
-
0
votes1
answer359
viewsChange image resolution via java code
speaks galera to coming up with a program to automate posting on a blog, and I need the images to be 500x500 always have how I receive the file and resize via code in java?
-
0
votes2
answers4152
viewsHow to get selectOneMenu primefaces value?
good evening. I’ve been having a little problem for 3 days, I’m not able to get the value of selectOneMenu related to the product, example: I have three product categories: Tapiocas, Snacks and…
-
0
votes1
answer74
viewsWhat to do after mapping?
I want to make a system to place and search data in a database. It is an agenda that the user inserts the location, the commitment and the priority. So far, that’s it. I’ve already started mapping.…
-
0
votes1
answer186
viewsUpdate does not update
The app works like this: An SMS is received, so the app checks if the number that sent this SMS is registered, if the app checks the first twenty characters of the message, which I call text…
-
0
votes1
answer1320
viewsTranslate date long format from English to Portuguese
I’m converting a String to Date SimpleDateFormat dateFormat = new SimpleDateFormat("EE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); Date convertDate = new Date(); String dd =…
-
0
votes0
answers960
viewsError trying to update: failed to lazily initialize a Collection, could not initialize proxy component <p:selectManyMenu>
I’m mapping a list with @ManyToMany (fetch = FetchType.EAGER), and I’m getting the following excpetion when I try to UPDATE a record in BD : ADVERTÊNCIA: failed to lazily initialize a collection,…
-
0
votes1
answer620
viewsPrimefaces - p:fileDownload PDF
Hello, I’m trying to download a PDF in my application but I’m not getting it. When I click on the Download instead of downloading is checking in the form if the required fields have been filled in.…
-
0
votes2
answers154
viewsHow to turn a system out to string?
I want to display a message on the device screen. The message is in System.out.println("Mensagem "); how do I turn into a string and print on screen using a textView?…
-
0
votes1
answer175
viewsp:primefaces editor tabindex does not work
In a view . xhtml I use the p:editor of the first faces <p:editor id="idDescription" tabidex="2" > ... When the tab key is pressed, after being in field 1, tabindex="1", it does not go to the…
-
0
votes1
answer57
viewsProblems saving with selectOneMenu.
I’m trying to save a record of Activities with information from Favored. I cannot save in any way. I will put the code and please if anyone can help me thank you. < package br.com.sentinel.Bean;…
-
0
votes0
answers50
viewsCSS When Sending JSP Email
Is there a way for me to send an email via java using even css? To be able to send the formatted body, I can, but I would like to put bootstrap in the email content //Criando a Multipart Multipart…