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
answer195
viewsMap Hibernate classes with Posit-id and joined-subclass
How can I map a class with Composite-id and extend another class? I’m using the example in: http://www.javacodegeeks.com/2012/08/hibernate-composite-ids-with.html I tried to change the code, but…
-
1
votes1
answer1836
viewsI can’t see console output on project with Wildfly
I can’t see any console output on a project with Wildfly 8.0.0. If at any point in my code I make one System.out.println("Qualquer coisa") Simply nothing appears on my Eclipse Kepler console. The…
-
1
votes1
answer975
viewsHow to test a DAO (using Spring and JPA) out of a container?
I am developing an application with JPA 2, Spring and JSF 2 running in Wildfly 8.0.0. I have developed some previous applications following this same specification but never tested properly using…
-
1
votes2
answers291
viewsError when instantiating an object
When I will instantiate the object Vendedor this error appears: java.lang.NullPointerException at Vendedor.<init>(Vendedor.java:9) I’d like to know what it means and how to fix it?…
-
1
votes2
answers325
viewsError running java program for printing through PHP
I have a web application that generates an image for a badge and to be able to send it automatically to print, I created a java program that does this. The program runs perfect, generated a jar,…
-
1
votes1
answer807
viewsPersist an entity that is inherited
I have an entity Person which is inherited in another entity Administrator. In the bank I already have data in the entity Person and I want to associate a Person in the entity Administrator. How can…
-
1
votes1
answer320
viewsimpact of a high heap memory on the JVM
What is the impact of having a high heap memory on the JVM? Does Garbage Ollector take longer to clear the memory when it is too high (around 12gb)? If yes, is there any way to prevent this delay…
-
1
votes1
answer7556
viewsHow to get the value of a particular item from the java android listview
How I get the value of a particular item(Textview) from listview. I’m trying something like this: public void onItemClick(AdapterView<?> a, View v, int position, long id) { Object obj…
-
1
votes1
answer71
viewsRecurrent error with TFS
I’m using Team Foundation Server for a work project. But I can’t download the code files present in the repository. Whenever I try a connection, Eclipse returns the error as in the attached image.…
-
1
votes1
answer142
viewsProblem with JPA
Classes and persistence.xml below. The problem is: entityManager is Coming NULL. @ManagedBean(name="pessoaController") @SessionScoped public class PessoaController{ private List<Pessoa>…
-
1
votes1
answer2615
viewsAdjust Image Size with Java Imagery
I would like to resize an image to be shown in my jLabel. Here’s my code: BufferedImage imagem; Icon novaImg; try { String newPath = "file:///" + aleat(); // carrega imagem aleatória imagem =…
-
1
votes3
answers1558
viewsJcombobox update from another Jcombobox
My idea was to make a Jcombobox whose values were updated according to the previous Combobox options. I’m using several Arraylists. For example, a Combobox with January and February option... If you…
-
1
votes1
answer2214
viewsDisplaying error messages in a web application
I have developed a simple web application to study some concepts related to Servlet among others. I mapped the file web.xml of my application to display a página de erro in case an exception occurs.…
-
1
votes1
answer321
viewsHow to know which image was clicked in java
I have 4 images in my layout, how to know which one was clicked and do conditional? my scribe: Oncreate: ImageView bancada_tv = (ImageView)findViewById(R.id.main_bancada); ImageView aguarda_tv =…
-
1
votes1
answer451
viewsUse interface implementation in a Fragment
I’m trying to implement an interface I created within a fragment, but I’m not succeeding. My fragment is being defined with the following code: package fragments; import…
-
1
votes2
answers3645
viewsHow to pass data from an Sqlite table to several Edittext fields
How to take the data from a table and present them each in one EditText? I’m developing on Android. Here I do the List of the data I need: public List<ConfiguracoesSistema>…
-
1
votes1
answer380
viewsDraw a line on Jlabel and Jpanel
I am finishing an old game, and I would like when someone wins the game, a line was drawn on the line, column or diagonal, in which the game was completed. I’ll post my code below: This is the game…
-
1
votes1
answer136
viewsSynchronization problem
This code worked on a Java IDE, but now on Android is not working. This program needs to get an XML dataset from a website and then move on to a spinner. import android.app.Activity; import…
-
1
votes1
answer1051
viewsProcessing of database exceptions
How to handle database exceptions with JPA? And, how to use annotations instead of the Imessage interface, as below? Example: My database returns error: "Violation Constraint uk_email"; Pick up the…
-
1
votes3
answers1169
viewsHow to load the list of items from p:selectOneMenu when clicking to open the dropdown?
I would like my p:selectOneMenu to reload the items and show the options every time I click to open the dropdown, has anyone ever tried this? If so, how do I?
-
1
votes1
answer1437
viewsHow to return a string from the method that queries Sqlite?
How to make a method that returns a string with a single result? I’m trying something like this: public String getString(String var) { String selectQuery = "SELECT * FROM "+TABLE_STATUS+" WHERE…
-
1
votes1
answer504
viewsHow to map a http request parameter to an Enum in java?
I’m making an ajax requisition like this: $.ajax({ type : 'POST', url : apiURL + '/play', dataType : "json", data : { against : "ANYBODY" }, success : function(data, textStatus, jqXHR) { // ... },…
-
1
votes1
answer129
viewsIs jBCrypt still safe?
I wonder if jBCrypt is outdated because it has not updated for two years https://github.com/josephw/jBCrypt If so, there would be a replacement for hashing and Salts for java?…
-
1
votes1
answer138
views -
1
votes0
answers81
viewsError "Assert: Shift is not as expected" when creating report
I created a report in Pentaho Report Designer. There are 13 pizza charts in a row, just changing the query from one to the other. When I added graph number 11 and went to visualize, I got the error…
-
1
votes2
answers445
viewsPass the object as argument
There is the +fazUmaCompra method in the Customer class that calculates the discount and the customer’s points, and at the end of the method, an object of type Purchase should be instantiated, but I…
javaasked 10 years, 7 months ago leonardokbruksch 319 -
1
votes1
answer82
viewsProblems compiling Bitbucket +Eclipse
I use Eclipse to compile/modify emulated game servers in Java and always use Assembla, it uses the build.xml to compile and never had problems. I have a project that I need to compile and is in…
-
1
votes1
answer248
viewsFloodfill with primefaces. Catch coordinate of click on p:graphicImage
I want to make an image painting application using java. As it is for the web environment I chose primefaces as a framework for the vast documentation that exists about it. However I did not find…
-
1
votes2
answers3071
viewsPass information from a selected item in the list to Edittext
Hello, I’m in trouble when I select a client in a Listview, I have to pass his name to a Edittext of the other Activity and pass the address also. But when I select the Customer he is grouping the…
-
1
votes1
answer865
viewsUpdate Progressbar in the background java android
How do I update the background service ProgressBar in the Android? My code: public void onClick(View v) { // inicial o progressbar progressBar = new ProgressDialog(v.getContext());…
-
1
votes1
answer911
viewsMaven Project - Click on Tomcat, but do not run
I have a project from Maven which, although the messages displayed on the Eclipse terminal inform that the Deploy was successfully done. When I type the URL into the browser, I get a 404 error; then…
-
1
votes1
answer167
viewsOrganization of codes generated by Windowbuilder
I’m using Windowbuilder to draw the graphical interface, but there’s one thing that’s kind of boring about it, and that’s this. When I create a Jlabel for example, it declares the Jlabel inside the…
-
1
votes1
answer124
viewsJava Database Authentication generated by Asp.net MVC 5(Generate passwordhash in Java equal Asp.net MVC 5)
I need to authenticate an automatically created user in Asp.net mvc 5 using the java language for example: user: so-and-so password: Ab123456 Password recorded in the Database PasswordHash…
-
1
votes1
answer174
viewsEnjoy Android API in Desktop Applications
Can I take advantage of the codes of an API made for Android and use in a java desktop application ? PS.: I don’t know anything about Java, I’m willing to learn. I only know Delphi and C++... In…
-
1
votes2
answers2753
viewsHow to add two tables in the same Arraylist
How do I add two tables in the same ArrayList? My code: { public ArrayList SQLConsultagetTodos_Completo() { String auxtexto=edtCodigoMovimento.getText(); int…
javaasked 10 years, 7 months ago Gelvazio Camargo 11 -
1
votes2
answers545
viewsRight structure to work with java (JSP)
I’m starting to develop with java (Jsp). And I would like to know the correct structure of working (only with java "pure"). Would that be: model (Classes with get and set) dao (classes that extend…
-
1
votes2
answers4662
viewsCheck repeated character and value in string array
I have an array of strings String[] jt = { "João Mendonça", "Mário Andrade", "João Mendonça"}); What’s supposed to be check out if the array contains at least one letter character and that has no…
-
1
votes1
answer253
viewsPan and Zoom in Imageview
I need to implement the movements of Pan and Zoom in the same image. Does anyone know how I can do it?
-
1
votes1
answer88
viewsJava Web Applets Crap
I need to access one of the company pages programmatically to download a large amount of reports automatically.. The company is large and each area can have their own systems and so are not…
javaasked 10 years, 3 months ago user3788133 11 -
1
votes3
answers2968
viewsHow to install Android Studio on Linux distributions?
I am new as linux user, and installed the jdk 7 using this procedure below: http://www.edivaldobrito.com.br/como-instalar-o-oracle-java/ Then I used this procedure to install android as shown below:…
-
1
votes0
answers289
viewsStarting Tomcat v7.0 server at localhost has encountered a problem
I am trying to start Tomcat Server locally, but this problem occurs. Could someone help me?…
-
1
votes2
answers396
viewsHow to create a stored Postgresql database from a Java source
Searching the internet for a solution to create a database on a Postgresql server for my Spring project, I found the following topic on Stackoverflow:…
-
1
votes1
answer1112
viewsSet at least one number in Edittext
My question is this:: Is there any way to prevent the click of a button if an Edittext has no number at all? I was able to limit minimum and maximum values (0 to 255), but I could not find a…
-
1
votes1
answer207
viewssocket failed: EACCES (Permission denied)
He was creating an Android project that makes him communicate with a Windows machine through Sockets, being the machine the server, and the mobile device (Samsung Galaxy S3 MINI) the client. I…
-
1
votes1
answer20770
viewsCreate Object Array in java and access objects directly
So I need to do the following I have a class with some attributes and methods, I need to generate a array of objects of this class, however I wanted to be able to access them directly, currently…
-
1
votes1
answer423
viewsJboss log reading
This code takes my file from log Jboss and displays the first 1000 lines. I wonder how I display the last 1000 lines? private String log; public void pesquisar() { String diretorioCorrente =…
-
1
votes1
answer343
viewsPrinted using Ireports
Good night, I need to develop a form for the standard 80x30mm that would be for thermal printer. I had thought of creating a model in ireports and at the time of printing call the model, but I’m…
-
1
votes1
answer1415
viewsThe JSF Autocomplete component does not work
I am with an application that should enter Social Reason, CNPJ and the city, the two fields Social Reason and CPNJ are working normally, however the field that has to type the city is giving this…
-
1
votes1
answer895
viewsChanging text from Textview
Suppose I have a text inside a Textview, there is the possibility of changing android:text remotely, without touching the xml, by means of a post in an external database, for example, a phrase…
-
1
votes2
answers1435
viewsDoubt about Listener for Jcombobox
Someone would know to tell me some listener for when I select an item in Jcombobox it gives me a warning for example. Remembering that when I open my component(Jframe) I select items inside by the…