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
answer1146
viewsSending Email Via Proxy - Javamail
This is my code: (UPDATED 2) I updated my account. I allowed access by external apps and then it worked !!! PS: but I had to make some of the suggested changes. So I marked the answer below as the…
-
0
votes1
answer24
viewsCalling method in Choicebox
I created a Choicebox, where at each selected level, a method should be called; but the following happens, any selected item calls the method; how to make a condition, that is, depending on the…
-
0
votes1
answer4124
viewsExport screen data to excel
I automated a customer registration test (performed on the Web, internet explorer) and at the end it generates a protocol and another numeric code. I need to save these two data at the end of the…
-
0
votes1
answer1430
viewsDemoiseller Signer - Loading a private key from a token
In the documentation of Demoiselle Signer we have the following example to load the private key of a token: KeyStoreLoader keyStoreLoader = KeyStoreLoaderFactory.factoryKeyStoreLoader(); KeyStore…
-
0
votes1
answer59
viewsHow to persist the value returned by a method?
In a class that has a collection, I need to persist the count of collection elements that follow a certain condition. Therefore, I need to save the result of a method that checks all elements of…
-
0
votes1
answer127
viewsError while adding strings to an array
My Activity of an Android app has this code. public class gerenciar2 extends ActionBarActivity{ boolean editar=false, adcionar=false, remover=false; SQLiteDatabase Banco = null; Cursor cursor;…
-
0
votes1
answer125
viewsIs it possible to instantiate an object more than once in a class?
I have a problem. I have 3 For’s, one inside the other, Inside the second For I make the instance of my object and soon after I pass the data of an xml file I read to that object and in the end I…
javaasked 9 years, 5 months ago DiegoAugusto 8,694 -
0
votes2
answers4842
viewsBringing an Object for a Resultset
I’m having trouble bringing the data of a Java survey, I’m using Postgresql and JDBC database for persistence, public List<Tapete> listarTapetes() { PreparedStatement state = null; ResultSet…
-
0
votes1
answer90
views -
0
votes1
answer171
viewsError in Eclipse execution
I downloaded the Eclipse, installed and performed the entire procedure correctly. As soon as I finished installing and restarting the PC, I ran the program and this error appeared: The Eclipse did…
-
0
votes1
answer141
viewsException released when using the Commons-email API
I’m trying to use the API Commons-Email as an alternative to the known JavaMail to send emails in Java but a problem is occurring. The following is being launched Exception: Exception in thread…
-
0
votes1
answer401
viewsHow to pick words and save in a string?
How do I save words I get in a string new? gravarArq.println(token.getLexeme() + "_" + token.getPOSTag() + "_" + token.getFeatures()); How to take what comes from token.getPOSTag() and save all the…
-
0
votes0
answers67
viewsError Found in Eclipse
I installed Eclipse, JDK and now I cannot run the program because this new error has appeared.
-
0
votes1
answer561
viewsError in SQL Server and JSP connection
I am trying to connect to SQL Server using JSP. However the connection is not performed. Connection Class: package DAO; import java.sql.*; public class Conexao { public static Connection conectar()…
-
0
votes1
answer369
viewsInterface vs Class - method visibility
I did a job for school and it’s working perfectly. In the code I have some private methods. I need to create an Interface of this class to hide these private methods or they can be in the same class…
-
0
votes1
answer123
viewsHow to make an array that increases if the user wishes?
I’m having a problem with a programming project. The program calls for the following: It is a Database of Questions (For example, a ENEM, or Vestibular). I PRECISE make some commands ,like add…
-
0
votes0
answers85
viewsProblem using "Frozen Columns" in Primefaces
I’m using the first faces with frozenColumns, in this way: <p:dataTable id="dataTable" var=.... scrollable="true" scrollWidth="800" frozenColumns="1"> Only when it breaks the line, the Frozen…
-
0
votes1
answer80
viewsFilter content below the main diagonal of a matrix
To take the content that is below the main diagonal of a matrix would be the elements at positions where the line is larger than the column?
-
0
votes1
answer153
viewsDeploying and webservice and client in Java with Eclipse
I’m having trouble implementing a java webservice with eclipse, some classes were not generated, but they are listed in the xsds files, I created a document in Docs to explain better. Thank you Here…
-
0
votes0
answers213
viewsMethod with Fileuploadevent from Managedbean not found: javax.el.Methodnotfoundexception
This is the error presented: ADVERTÊNCIA: Method not found: [email protected]() javax.el.MethodNotFoundException: Method not found:…
-
0
votes4
answers2941
viewsSplit String using comma as parameter
I am trying to get the values of a Listview to send them to another screen by clicking on the item. So I have the following code: @Override public void onItemClick(AdapterView<?> parent, View…
-
0
votes0
answers184
viewsString.format() with error
I need to format the following string with the respective parameter, but this generating the following error: Caused by: java.util.Illegalformatconversionexception: %d can’t format java.lang.String…
-
0
votes2
answers318
viewsHow to remove a View from an xml layout?
for example... I want that when inflating a layout with a certain class, it removes the unnecessary views and uses only the necessary ones... There is a method to remove views?
-
0
votes2
answers973
viewsImage does not appear after Gero o . jar
How do I get my image to appear in the application after the . jar generation? I’m doing it this way and it’s not working. @FXML private ImageView image; @Override public void initialize(URL url,…
-
0
votes0
answers115
viewsHow to read a pre-formatted string?
I have a file with String in a certain format, I would like to capture this string some information. Example: 0:13:13 - ID:( usuário ) / Name:( nome ) / IP ( 177.22.XX.X ) Memory Function Code Error…
-
0
votes0
answers185
viewsAdapt jComboBox Code with Autocomplete
Option 1: How can I adapt this code to my project? I created the Autocompletation class and then put it in my constructor: AutoCompletion.enable(yourComboBox); I dragged my combobox in the design…
-
0
votes2
answers502
viewsLayers to develop web service
I am developing using REST (with Restfull API), where I think of using two layers in the system: BLL and DAL. BLL => Would be the layer referring to business rules. DAL => It would be the…
-
0
votes4
answers1258
viewsHow to create an executable . jar?
Build a java project on eclipse, if yes, how? Otherwise, as I compile a project in Java? I was able to turn the code into . jar by eclipse. Only when I click to run it, it just doesn’t open. I…
-
0
votes1
answer4021
viewsRead a TXT file, sort, and save a new Java file
I’m doing a job for college, and I’m not being able to read the file and throw the dice into a Arraylist to sort the data, below follows as is my code so far public class Teste { /** * @param args…
-
0
votes1
answer65
viewsAndroid - Nullpointerexception Error
I’m getting the following error randomly, IE, gives error sometimes and sometimes not: Caused by: java.lang.NullPointerException at pt.cartuxa.Login.onCreate(Login.java:62) My line 62 is as…
-
0
votes2
answers602
viewsEclipse (java project) - src folder error
I hope you can help me... after I installed everything (all the same: ADT, Eclpse, SDK and ALL Android Updates )), no matter how many projects I create, always error in folder SRC of the eclipse,…
-
0
votes1
answer205
viewsHow to get the value of a memory variable?
I course the first period of CC and would like to know how I could achieve variable value of a game, for example, in real time. For example, when a boolean variable changes the value to TRUE, I…
-
0
votes1
answer924
viewsJson upload via android GET
Problem with special characters (keys, parentheses, etc) which contain in a json I’m sending via GET. android generates the following log: > E/AndroidRuntime(1956):…
-
0
votes1
answer50
viewsContinue after run() finished
I have a class with the name Request_Login validates the login data with the server and a string LOGIN_RESPONSE which stores the server response. When data is submitted in the form and pressed enter…
-
0
votes1
answer423
viewsshow on the screen the position content?
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.PrintStream; import java.util.Scanner; public class…
-
0
votes1
answer45
viewsInputdialog vertically
My problem is that I want to create a graphical interface with input fields vertically, but I can only create horizontally. Code: JTextField mapField = new JTextField(5); JTextField tamField = new…
-
0
votes1
answer956
viewsAdjust display of a monitor resolution-independent application
I made an application Java And I realized that when it runs on a computer with higher resolution, it gets smaller. How to adjust display of a monitor resolution-independent application?…
-
0
votes1
answer138
viewsOrientation to Objects in Java
I’m new to Java and I’d like to understand how it works. Like, how I use classe inside the other (and what’s it called)? protected void onCreate(Bundle savedInstanceState) {…
-
0
votes0
answers91
viewsTap Close App button
Follow this tutorial to create a layout with tabs. After that, I created an XML button, which is displayed without action, because it is only in XML. I want to open another Activity from the touch…
-
0
votes2
answers758
viewsNullpointerexception error when using JSF EL
When I add this line of code to my XHTML page: <f:param name="pedido" value="#{pedido.id}"/> It generates this error: jun 04, 2015 10:59:42 AM…
-
0
votes0
answers74
viewsException in Initialcontext jboss
Hello, I am developing a java project with jboss. I made the following code: connectionFactoryLookupAddress = new String("jms/RemoteConnectionFactory"); destinationLookupAddress = new…
-
0
votes0
answers255
viewsSpring Security with Jboss leads to error`Circular view path...`, what is wrong?
In an attempt to get Spring Security working with Jboss, based on the GS-Security-WEB example, I am receiving the following message by logging into the available testing Urls: Log Out 12:40:16,051…
-
0
votes2
answers4140
viewsError opening Activity: The <application> stopped
I have a file VigasFragment.java with a button that when touched should open the Activity VigMetBiapsb.java, however some error occurs, closing the application. Vigasfragment.java: public class…
-
0
votes1
answer251
viewshelps in capturing multiple strings and storing them in an array
String names = "<td><input type="radio" name="pergunta23g" value="SIM"/> Qual? <input type="text" name="pergunta23gQual" class="dados"> Onde<input type="text"…
-
0
votes1
answer58
viewsHow to receive the return of a selected text in windows?
I wonder if there are any classe no java, with some method that allows me to receive those text passages that we selected with the course of text in any document within the Windows(is a text of a…
-
0
votes1
answer360
viewsWhy does the app stop when I leave the field empty?
public class VigMetBiapsb extends Activity { int porctAlt, porctLarg; double edtVaoNum; EditText edtVao; Button calcBiapsb; TextView secaoBiapsb; @Override protected void onCreate(Bundle…
-
0
votes1
answer900
viewsHow to create administrator profile from that code?
How to create an administrator profile from that code, and when logging in a check is made whether you are an ordinary user or an administrator? Daousuario.java package br.edu.facema.model.dao;…
-
0
votes1
answer1570
viewsHow to assign click effects to an Imagebutton?
For example, I added to my xml layout an Imagebutton, put an image and left with transparent background, for having done that it lost the characteristics of a button, how do I add click effect?…
-
0
votes1
answer239
viewsInterleaved matrix
Hello, I’m doing this exercise, but I’m having a hard time. Follow the statement: 22) Write a program to generate one matrix (N x M) (<=20) and another (N x P) (<=20). Generate a third matrix…
-
0
votes1
answer638
viewsDefine method within the body of another method in Java
Hello, I was researching on Java and I came across the following code: cliente.getInetAddress().getHostAddress() I didn’t understand it very well. Is this a method within another method? I tried to…