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
-
2
votes1
answer213
viewsComparable and Arrays.Sort
I’m having difficulties in using the similar interface, I must perform the increasing comparison of drivers according to their score (class PilotoEquipe), and then in class CorridaX1, need to use…
javaasked 10 years, 2 months ago leonardokbruksch 319 -
2
votes1
answer441
viewsJava stack intercalating values
have two stacks have to create the third interleaving the values of the two stacks created the stack and all I’m having a lock to implement the code to interlink follows the code: public class Pilha…
-
2
votes1
answer5336
viewsDetecting colors or geometric shapes of an image
Is there a framework for detecting colors or geometric shapes within a static image, such as a . jpg? Preferably for C# or java Hypothetical scenario: The framework would identify that there are 3…
-
2
votes1
answer441
viewsGet list of JPA/Hibernate Persisted objects
Hello, how do I get the list of persisted objects before committing it in BD. Follow the example below: Pessoa p = new Pessoa("Joao", 21); Pessoa p2 = new Pessoa("Pedro", 17); Pessoa p3 = new…
-
2
votes1
answer1803
viewsCalculate clicks per second
How do I calculate how many clicks were given in 1 second?
-
2
votes2
answers1318
viewsProblem when passing polluted bean to controller and insert in BD using Java with Spring mvc
I wish you could help me with this problem that is occurring in my application. Below is the code: package br.com.estoque.Controller; import java.util.Map; import…
-
2
votes1
answer178
viewsAlternative Methods for Application Server Storage
Good Afternoon Staff, I would like some suggestions for alternative ways of accessing data on an application server, more specifically a Jboss 6. It happened that I have an application hosted in a…
-
2
votes1
answer292
viewsVector in Java with fields in each cell
I’m doing a work in java and need to know how I do a structure similar to a Struct of C, where each cell of the vector has 3 fields, example vector[i]. age, vector[i].altura.. If someone can show me…
-
2
votes1
answer914
viewsPrint Enum field in Jasperreports
I created a Enum which has a description field for each of its items. In my report on Jaspersoft Studio i want to print this description field and not the name() of Enum. I created a field in the…
-
2
votes1
answer1372
viewsUpdate column and table settings with Hibernate
Good afternoon. I would like to know and confirm if you have any way to update table and column definitions in each schema using Hibernate. For now, what I’ve seen so far is that Hibernate only…
-
2
votes1
answer1981
viewsHow to customize the line of a Listview according to the value in Arrayadapter
Assuming I have an object called Item, and it has the text, id and validation property, in which case, text is a string, id is an integer, and validation is a boolean value. class Item { private int…
-
2
votes2
answers4746
viewsHow to adapt an Android app to various screen sizes?
For example, for example... I want the app on Android to be presented equally both on screens from 5" to 3"... And how do I apply a "scrolling" layout, how to add a scroll to the Android layout?…
-
2
votes1
answer237
viewsIs there a Java function equivalent to drawPixel?
I wanted to know if there is any function in java that Plot a pixel, something like drawPixel or setPixel that I see in some other programming languages, in which you report as parameters the X and…
-
2
votes1
answer679
viewsHow to Parse a Web Service XML Response
Hello, I would like to know how I parse a reply in xml that I get from my web service.. In this case, I am doing on Android, and wanted to transform the values and names that display in xml, in…
-
2
votes2
answers548
views -
2
votes3
answers10545
viewsRegular Expression White Space
With the following regular expression (^DOC)*[0-9] I can capture all numbers after the "DOC" sequence. However, by testing this text : TEXT TEXT TEXT DOCUMENT:240010 24/09/2014 It returns me…
-
2
votes1
answer1453
viewsImproved Application to Server Communication
I am developing an application that needs to communicate with the server (send and receive data). What would be the best way to make this data exchange safely and performance? Through REST/WEB…
-
2
votes1
answer512
viewsHow to correctly sort a JSF <ui:repeat> tag
I have a code put in the view view it’s coming out disfigured. <ui:define name="conteudo"> <h:form id="content"> <ui:repeat value="#{mbProduto.resultado}" var="prod"> <div…
-
2
votes1
answer574
viewsAdd Maven to a Web Application Project
Good morning, I am using a Web Application Project, to be able to use the Google App Engine. I wish I could download the . jar and its dependencies using Maven, someone knows how to add Maven to my…
-
2
votes2
answers81
viewsHow to keep the layout in standby mode?
Well I have two layout teste_1 and layout teste_2 , when I turn apparatus for portrait appears teste_1 and when I turn apparatus for landscape appears teste_2, have to leave this layout in standby…
-
2
votes1
answer2316
viewsProblems with the . jar
Good morning guys, good I have a Maven project running over Netbeans however, the .jar generated says at time of execution: "no major manifest attribute in example.jar". I heard there might be some…
-
2
votes1
answer269
viewsAccessing Wifi settings from android (IPV4)
I’m accessing the Wifi settings of Android, and is charging as if I’m searching for a standard IP IPV6. I wonder if there is any Wificonfiguration property to set to IPV4
-
2
votes1
answer1120
viewsIs there any method that returns information about the smartphone?
I want information like the version of Android and device model, the method System.getProperties() me returns the properties of the App.
-
2
votes1
answer2300
viewsSend message from a web java application to Whatsapp
Guys, I wonder if there is the possibility to send message from java web application to the Whatsapp application. Is there a class or api that can help? Example: the person makes a purchase and when…
-
2
votes1
answer1859
viewsRead each existing Line in Stringbuffer or String
I have a text with the following format: Data Valor 20140901 278 20140902 248 20140903 458 20141004 545 20141005 125 20141106 1020 20141207 249 It is stored in an object of the type StringBuffer and…
-
2
votes1
answer1176
viewsThe Primeface confirmation screen does not work
This is the screen that appears in my Browser When I press the delete button it simply does nothing. Does not generate any error on the eclipse consoles This is the separate code is problem here!…
-
2
votes0
answers426
viewsException when deleting directory using Fileutils.deleteDirectory
The directory has 6 files inside it. The exception is java.io.Ioexception: Unable to delete file: tmp umDosArchives. Manually, I can delete all the files and the directory. I used the canWrite…
-
2
votes2
answers353
viewsHow to increment variables
In the code below my variable y asks the user to enter values until y reaches 10, I store the variable x and currently the last information typed is stored (which shows at the end of the code) what…
-
2
votes1
answer161
viewsFramework (Java) for Opening remote sessions for executing Unix-based Server commands
I needed a framework to be able to open remote sessions on (Unix-based) servers and run commands remotely (if possible as root even). Does anyone know any mature who can serve this purpose? Main…
-
2
votes1
answer676
viewsHow to maintain the layout of the components created by Windowbuilder in eclipse after compilation?
I created a Jframe using the Eclipse Windowbuilder plugin. Spacing, sizes and patterns have been defined. However while compiling the project the patterns are lost. Below the 2 photos for…
-
2
votes2
answers87
viewsDetele() - Play Framework - Compilation error
Introducing I am doing a CRUD in my application, everything is perfect but my delete is giving error when compiling Error Task java. package models; import java.util.*; import java.util.*; import…
-
2
votes1
answer2618
viewsChained JAVA Lists
How to invert a simple chained list in Java? For example, I have the following values: 3 - 2 - 1 and the end result will have to be 1 - 2 - 3. Note: no use of native Java functions such as…
javaasked 9 years, 8 months ago Dan Lucio Prada 772 -
2
votes1
answer963
viewsassign a function to a key on the keyboard
I’m creating an application for a cattle auction where has lot, sex of the animal, whether it is the view or the term and the value field of the lot where increases while the auctioneer speaks the…
-
2
votes1
answer192
viewsWhat is the difference between the following methods?
I am developing a JSF application and came across the following methods and want to know the difference between them. ((HttpSession)FacesContext.getCurrentInstance()…
-
2
votes1
answer199
viewsLoad/read/use jar file via web
It is possible to load/read/use a web jar without having to download it and use it in the classpath? If it’s possible how I do it?
javaasked 9 years, 8 months ago user22408 -
2
votes2
answers1169
viewsDoubt - setDefaultCloseOperation
It would be possible to somehow pass to: setDefaultCloseOperation(UM METHODO?); Or using some other option to do the same procedure? What happens is that I created a button and it calls a "method"…
-
2
votes1
answer2235
viewsException org.hibernate.Propertyaccessexception: could not set a field value by Reflection Setter
I’m trying to map the following model in JPA with Hibernate: Company table: CREATE TABLE empresa ( id_empresa INT(11) NOT NULL AUTO_INCREMENT , PRIMARY KEY (id_empresa) ) ENGINE = InnoDB DEFAULT…
-
2
votes1
answer619
viewsDirect printed in Java
I need to create a form to be printed on a thermal printer (not tax), in case I thought to create a printed by Jasperreports but Jasper searches the bank for the information and wanted to get the…
-
2
votes1
answer71
viewsProblem with Openshift + Mentawai
I have a problem regarding Openshift. I have already moved up my application (java/jsp) and my database (postgresql) and it seems to be Ok. The problem is that I use Mentawai as the mvc framework…
-
2
votes1
answer14856
viewsHow to organize random integer values in descending order in a Java array?
I need to organize the values that the array receives randomly and leave them in descending order, but honestly I don’t know how to do it, there’s my code, I couldn’t organize. package…
-
2
votes2
answers2470
viewsMethod with generic return
How do I make a method that returns a type informed in the parameters? public <E> E to(E e) { return (E)obj; } String st = to(String); Integer it = to(Integer); But it creates error, there’s…
-
2
votes1
answer450
viewsHide tab - Java
I have a program with several tabs, so I will be if the user is ADMIN, based on this I would like to hide/disable some tabs, I have already tested these commands and do not disable the window:…
-
2
votes2
answers1749
viewsDraw a pixel-by-pixel image
I’m trying to make a stupid little program but I’m not getting it. I want to randomly redraw a pixel-by-pixel image, doing this with multiple threads. I don’t know much about Java Swing, so I’m…
-
2
votes1
answer106
viewsSorting an Array
I have my class ItemList public class ItemListPropaganda { private int iconeRid; private String texto; private int valor; public ItemListPropaganda(String texto, int iconeRid, int valor) {…
-
2
votes1
answer134
viewsConfigure Relational and Non-relational Databases in the same project with Spring-Data + Hibernate
I am trying to create a Java application where I need to configure two databases: Mongodb and Mysql. My idea is to use Spring-Data with Hibernate for both banks, but I found only tutorials for…
-
2
votes1
answer2234
viewsEvent click on Image Javafx
I have an implementation being developed in Javafx only that I came across some situation that seem to be simple, when designating an Event the image in your Onmouseclicked from my FXML got the…
-
2
votes1
answer1157
viewsHow to display a matrix graphically?
I have a matrix Tabuleiro[][] tabuleiro = New Tabuleiro[20][20]. It contains objects from a class not yet implemented, which will have some values, such as cell color and a position marker. I would…
-
2
votes1
answer174
viewsError while displaying web images in android java
I’m trying to display images from the web in a ListView, but they appear out of order, on the wrong lines and change position with each update of Activity. Activity: public class…
-
2
votes1
answer151
viewsHow to see memory consumed by the web application?
I have a web application with Spring running, I would like to know how to see the memory consumed by the same.
-
2
votes1
answer448
viewsList View - returning more than 1 data in a row
I’m implementing a app and I have to have a list view which shall list ALL previously registered "NOTES" using the listing method implemented in the DAO; Each line of Listview must present the…