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
votes2
answers629
viewsDecrease space between two Jpanel in the netbeans prototyper
Good afternoon, everyone. I am using netbeans 7.4 to create a simple screen. It turns out that on this screen (frame0 by default), I added two panels (Jpanel). One to be the header and one to be the…
-
-1
votes1
answer3317
viewsCreate folder in your device’s internal memory and display message after saving
I’m in two trouble. The Toast in my method returns me the following error: The method makeText(Context, Charsequence, int) in the type Toast is not applicable for the Arguments (Gerarrelatorio,…
-
-1
votes1
answer250
viewsCheck events that occurred in a given period of time
I need to register the following event in my program: Players who kill 5 times during the 1 minute break will win a prize. My class mapping is as follows: public class Game { private String name;…
-
-1
votes2
answers271
viewsUsing data in the database
I am creating a quiz. I managed to create the screen to create the questions, this recording in the database everything right. Only now I will do the "game" itself, so I would have to take a…
-
-1
votes1
answer754
viewsException in thread "AWT-Eventqueue-0" java.lang.Classcastexception: [Ljava.lang.Object; cannot be cast to [Lbr.com.jcom.modelo.Brand;
I’m making the following mistake : Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lbr.com.jcom.modelo.Marca; at…
-
-1
votes1
answer1370
viewsCreate a website with JAVA programming?
I would like to know how to start creating a simple website through JAVA programming. If anyone can help or indicate any tutorial, thank you very much! Thank you
javaasked 10 years, 2 months ago Pesquisa IFSC 7 -
-1
votes1
answer767
viewsUpdate Android Database
I’m creating a database on Android that has a column called status where is saving (0 or 1) 0 for when you are without internet and 1 for when you have internet, I want to do the update from the…
-
-1
votes2
answers3910
viewsGet first digits of a number in Java
How do I take part of an integer number in Java? For example, I have a variable int a = 12345678, and the user wants to receive only 4 digits.
-
-1
votes1
answer232
viewsGx X Ev3, Development Genexus Java Environment
Note: In Genexus, which is a "creator" of code packages for agile development, there is no need to code in common language like Java. Just creating the transaction specifying its attributes is…
-
-1
votes1
answer1278
viewsHow to read multiple lines from a text file (.txt) and store them in the same variable?
Someone has an idea to help me extract the lines below and that always present themselves in this pattern? Palavra1 (é sempre igual) Linha a ser extraida, de tamanho variavel Linha a ser extraida,…
javaasked 10 years, 6 months ago StatelessDev 2,534 -
-1
votes1
answer64
viewsDecision problem within an array loop
My problem is in the second if, what I was actually trying to do was to determine that at the time the loop was passing through position 11 of the array it would add the " n", but the way I did it,…
javaasked 10 years, 6 months ago Adrian Roger 129 -
-1
votes1
answer245
viewsTabhost open a new acitivity after clicking on a list
Guys, I’m beginner in android my doubt and the following. I met the Tabhost component and found it very interesting to implement it in the application. The app has a list of restaurants and one…
-
-1
votes1
answer220
viewsSave user profile photo when reloading to chat system using socket
I developed a Java chat using sockets where you have to choose a profile photo after logging in. My question is: How would I save this photo chosen by the user and reuse it in a future login? In the…
-
-1
votes1
answer6781
viewsHow to sum the values of each row of a matrix?
How to sum the values of each row of a matrix and store the sum in one array? Example: 3 3 3 2 3 4 2 2 2 Results in: 9 9 6
-
-1
votes1
answer124
viewsSending object to Android client, what to use?
I am developing an Android app that is a table of a football championship with the results of the games presented in a list. As the games happen I register in a database and send the result to…
-
-1
votes1
answer340
viewsnew File() does not create the file
When creating a program that generates an input file for another program, the problem occurs that the file I try to create by new File() is not created. Follows the code: import java.io.File; import…
-
-1
votes1
answer1510
views -
-1
votes1
answer5821
viewsGenerate sequential number in java
Hello, I have a Student class with the attributes name and enrollment. The user can enter the name by setNome(), but I would like to know how to make the registration is generated automatically (1,…
-
-1
votes1
answer308
viewsHow to "set" a Query in the @Entity annotation with Hibernate?
I have the following class: Java student. @Entity public class Aluno implements Serializable { @Id @Column(length=11, nullable=false) private int cpf; @Column(nullable=false) private String nome;…
-
-1
votes1
answer290
viewsCampo Jtextfield
How to convert a component JTextField for type Date? How to do research? How to create a query for the bank by returning a list of orders according to a date range? Follows the code currently used:…
-
-1
votes1
answer158
viewsPreparedstatement Not Initialize(stm = >"stm" is not a known variable in the Current context.<)
Preparedstatement declared not initialize You have an error on line 83, stm declared on line 21 is not initialized. import java.io.PrintWriter; import java.io.StringWriter; import…
javaasked 10 years, 3 months ago Vagner Wolf 3 -
-1
votes1
answer785
viewsHow to create a search filter for a Three-Dimensional String?
I have a ArrayList of the kind String Three-dimensional: String[][] And I would like to do a search system that filters the values, example: String[][] table = {{"Ronaldo","32","Atacante","Sao…
-
-1
votes1
answer1135
viewsHow to register a photo using Uploadedfile from primefaces? I was able to save the photo inside the photo variable but I can’t save it in the database
Console message: set 02, 2015 11:05:01 AM com.sun.faces.config.ConfigureListener contextInitialized INFORMAÇÕES: Inicializando Mojarra 2.2.8 ( 20140814-1418…
-
-1
votes2
answers3817
viewsHow to format whole number in currency with javascript?
Example var number = 3500; I want you to return 3,500
-
-1
votes1
answer2773
viewsUnable to build Entity manager Factory errors Help aq please
Unable to build Entity manager Factory errors in application. JPA, Hibernate, Postgresql, MAVEN, Tom Cat and Eclipse. These errors have occurred below: nov 03, 2015 8:33:35 PM…
-
-1
votes1
answer446
viewsSearch on a website
Good afternoon.. I need to do a java project in netbeans that the program goes to the site and searches for what was typed in the program’s text field. My theme is recipes and the site is cybercook,…
javaasked 10 years, 1 month ago Gabriel Dezena 23 -
-1
votes1
answer99
viewsAndroid + Webservice on Cloud Platform
Fala galera... Well, I really need to create a project. A WEB and Android system. But it has to be Cloud and free of charge. I researched and started a project using Openshift. I installed a plugin…
-
-1
votes2
answers280
viewsCheck the diagonal of a specific index
I wanted to know how to check the diagonal of a particular index, for example, put 1 in all the numbers of the diagonals of row 2, column 2 0 1 0 1 0 0 1 0 0 1 0 1 1 0 0 0…
-
-1
votes1
answer106
viewsCode does not compile with several errors
import java.util.Arrays; public class OrdenaArgumentos { String [] nomes = new String []{ " rafael cosentino ", " jonas hirata ", " marcelo martins "}; java.util.Arrays.sort…
-
-1
votes2
answers1112
viewsHow to select all columns of a row?
It is possible to select all columns of a row? I have a function where, on the screen where the user will be created, a validation is made in the first field typed to verify if the ID user I am…
-
-1
votes1
answer54
viewsProblem to run project
I can’t run my project from the bug "com.android.ide.common.process.Processexception: org.gradle.process.internal.Execexception: Process 'command 'C: Program Files Java jdk1.7.0_79 bin java.exe''…
-
-1
votes1
answer415
viewsRestart Your Phone
Any code hint to restart your phone after an action? Example: After performing the backup, I need the phone to restart to finish the settings.
-
-1
votes2
answers331
viewsString Statement
I’m declaring a variable like this: private String[,] soloMarciano; Can you do this in Java? Because I need to read two X and Y positions.
-
-1
votes1
answer60
viewsHow do I access the text size (Texview) and compress the text box (Textview) via code?
I’m looking to create a AutoScale TextView, I needed to access the text size and length via code. I’ve been searching the internet I found enough code referring to the theme of the question, as they…
-
-1
votes2
answers107
viewsUpdate serial ID when a table is NULL
I’m making a java desktop program, with a product ID automatically incremented by SERIAL. However, when I delete some element or all, the value of the sequence stays on the last one that was added…
-
-1
votes1
answer148
viewsI’m having trouble saving the contents of a docx in pdf
I have a Rest method that takes a Word document, replaces the placeholders and converts it to PDF and saves it to a directory. But I have a Nullpointerexception I couldn’t solve, someone can help?…
-
-1
votes1
answer85
viewsJava working on JSON
Well, I am starting my studies in java, for this reason I am a little raw in the possibility, in libraries and other qualities that exist in programming JAVA. Inside many doubts I would like to…
-
-1
votes2
answers828
viewsGet Json properties name
How do I get the properties names of a Json using the library Gson? Input example: { "Ficha":[ { "nome":"nome", "sobrenome":"sobrenome", "idade":"idade", "endereco":"endereco", "empresa":"empresa",…
-
-1
votes1
answer2404
viewssearch for depth and width using graphs
I need a code that does a wide and deep search using graphs for the shortest path search, analyzing these aspects mentioned, but I don’t know where to start, I would like someone to help me, serve…
-
-1
votes1
answer511
viewsEclipse ADT does not work
[2015-05-23 11:29:54 - Jokenpo] /home/gabriel/Área de Trabalho/Jokenpo/res/values/styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name…
-
-1
votes1
answer140
views -
-1
votes1
answer1014
viewsHow to call a Jframe from another Jframe with different classes
I’m creating a little game of rock paper and scissors and would like to know what I call a JFrame other’s JFrame, only from different classes. Or maybe I should do it in different methods? I tried…
-
-1
votes1
answer709
viewsExtract existing value between two regular expression tags
How to check from a regular expression whether there is a certain value between two strings, for example, tags <code> and </code>? I want, for example, to know if there is between the…
-
-1
votes1
answer1818
viewsHow to pick up only links in a source code?
Since last night I try to make an algorithm to search line by line and return only links, but it’s complicated, either I’m dumb or the class methods String , that I know, doesn’t help much.…
-
-1
votes2
answers26904
viewsHow to Export an HTML table to PDF and EXCEL
Good morning guys, someone has to give me a help regarding to export an HTML table to PDF and EXCEL, I better do this in javascript(front end) or java (backend) any hint help! thanks.
-
-1
votes1
answer97
viewsError to open link in Chrome and IE browsers
I’m using Javamail to send a link to reset the password, but when I click on the link and it only opens in Firefox, I can’t open it in Chrome or IE, only if I copy the link and put it in the URL,…
-
-1
votes2
answers53
viewsDoubts regarding applet 'param' and an Archive pointing to a jar
I can’t understand what this applet stops at, does anyone explain to me? And why does the applet have that Rchive that points to a jar? Why do they stop? <applet code="TesteApplet.class"…
-
-1
votes3
answers1182
viewsHow do you hide a div when it’s empty?
I have a div to show alerts to the user when a new user is successfully registered, but I only intend to show this message in the div, IE, the div when it is not empty. How do I do? Note: I saw an…
-
-1
votes1
answer458
viewsDifference of dates with Legend in a Textfield
I am developing a hotel system and would like to automate some features in the system. I would like that when you select two dates being the dataEntrada and dataSaida using Calendar, make that when…
-
-1
votes1
answer101
viewsCollection for stock use
What is the best implementation of the Collection interface for implementing a stock class? For example, a stock of supermarket products. My scenario is this:: A system of stock management of a…