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
answer71
viewsPassing String between classes
I got my main class where I got ... String ola = "Hello fellas"; and I have my other class: public class NotificacaoDiaria extends BroadcastReceiver { @Override public void onReceive(Context arg0,…
-
0
votes1
answer965
viewsAdmob - Problems with Ads in APP
I did everything as ADMOB site tutorial says, I put the layout in XML, imported the path from Google Play Sevices and added the tutorial code lines, my application compiles, but no longer opens on…
-
0
votes1
answer1608
viewsFill values in a vector and ask position and values
public class teste4 { Scanner op = new Scanner(System.in); int[] vetor = new int[10];{ for (int i = 0; i < vetor.length; i++) { System.out.println("Digite o valor da posição " + i); vetor[i] =…
-
0
votes1
answer1168
viewsHow to create objects from a text file in Java?
Hello. I have a class in my project (Person) that contains attributes (e.g., name, age, gender, etc.) and I have an array of these objects (Person). I also have a text file and inside it is typed…
javaasked 10 years ago Pedro Carvalho 65 -
0
votes1
answer49
viewsconvert from Date to number in Java
I have a field in the Mysql Date database and within a function modelPie.set(String, number) I want to bring this field but java says it cannot convert from Date for Number.…
-
0
votes3
answers1045
viewsSeparate values from List
I’m using List to sort some values, but I need to separate them after I manipulated the values. List<Map.Entry<String,Integer>> lista = new…
-
0
votes1
answer231
viewsCode prints twice but should print only once
I wonder why at the time I run the algorithm, the line that asks to type the student’s name is printed on the screen 2 times. Scanner input = new Scanner(System.in); System.out.println("Quando o…
javaasked 10 years ago Ygor Ramos 1 -
0
votes1
answer393
viewsSystem.getProperty() on the server
In my code I use System.getProperty("user.name") to get the local username. But I would like to use my application on a server. And by spinning it instead of returning what previously returned…
javaasked 10 years ago Fillipe Sanches 45 -
0
votes1
answer1120
viewsHow to set font size in PDF?
I am making a report using iReport this all ok, but in the application when generating PDF the source is not the same as in the iReport preview, the font type is ok, I would like to know a way to…
-
0
votes1
answer1057
viewsProblem updating Listactivity using a custom adapter
I’m working on an app where I populate a ListActivity using data from a SQLite created by the program itself. When adding items in the database, the list is automatically updated, but when removing,…
-
0
votes1
answer532
viewsProblems with Adapter in Fragment
I’m having trouble with Adapter in Fragment. Meu Fragment: public class HomeActivity extends Fragment { private final DataBaseHandler db = new DataBaseHandler(getActivity()); public View…
-
0
votes1
answer55
viewsTabhost does not call the onTabChanged() method
Because when you start Tab, you don’t call the method onTabChanged(). public class MainActivity extends TabActivity { private TabHost mTabHost; @Override protected void onCreate(Bundle…
-
0
votes1
answer1222
viewsGet item data in Listview
I’m developing a college project that consists of an agenda that works with Sqlite database. It may seem trivial, but the way I’m proceeding makes things a little more complex. I want that, when…
-
0
votes1
answer4810
viewsHow to Select Java Listview Item
How to use the method to work with the selected Listview item? Activity: public class ListaProntos extends Activity implements AdapterView.OnItemClickListener { ArrayList<Contact> imageArry =…
-
0
votes1
answer311
viewsLimit access to the app in google play
It is possible to create some criterion that makes it impossible to update my application in the published google play? Current scenario: I have a sales force system on Android and an ERP on Desktop…
-
0
votes1
answer1324
viewsHow to create Listview with Sqlite data in Fragment
How do I insert the Sqlite data into this listview of my code: @Override public void onActivityCreated(Bundle savedInstanceState) { String[] sCheeseStrings = {"Emerson","Simone","Samara"};…
-
0
votes2
answers191
viewsjava lib for hardware query
I am wanting to check on a VM of mine at Amazon if the hardware I bought is really what they offer me. I would like to make a framework or API just to check the amount of memory, HD and processor.…
javaasked 10 years ago DarkJontex 75 -
0
votes1
answer166
viewsHow to add an Imageview to a Relativelayout on a runtimer?
How do I add a ImageView at run time to LinearLayout or even a TableLayout?
-
0
votes1
answer2768
viewsHow do I connect a java program with oracle 10g?
I tried to make the code below but it didn’t work, I’m using Oracle 10g. import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet;…
-
0
votes1
answer500
viewsHow to test the creation of an obj and method call in a Servlet?
I’m trying to create a web application using TDD, however, I’m having a question of how to test the Servlet that processes requests and calls due logic, I don’t know how to do the assert. @Test…
-
0
votes1
answer244
viewsHow to put a global shortcut to restart servers in debug mode in Eclipse?
How can I set up Eclipse (I am currently using Kepler) so that by pressing a keyboard shortcut, for example, F12, the Tomcat server starts or restarts in Debug mode? I managed to make the F12…
-
0
votes1
answer301
viewsChange the background color of Actionbar with Tabactivity
I’m having trouble changing the background. When I wear it like that, with the extends of TabActivity: public class HomeTabActivity extends TabActivity {... private android.support.v7.app.ActionBar…
-
0
votes2
answers195
viewsJDK Java EE 7 without Glassfish
I am trying to install JDK from Java Enterprise Edition and would like to know if you have any installation option without Glassfish 4, I want to use Tomcat and not Glassfish, so is there any way to…
-
0
votes1
answer458
viewsget current url of a java network
I need some way to get the url’s accessed on a computer network, I’ve seen enough, I found a code that uses socket but it’s a host only, but cannot be of a host individual, I want the whole network,…
javaasked 9 years, 11 months ago Thiago Silva 1 -
0
votes1
answer54
viewsInsert NIB into database
What type of data is indicated to receive the NIB (Bank Identification Number) in a database? The NIB consists of 21 digits. I have tried but the following error appears:…
javaasked 9 years, 11 months ago Hugo Machado 866 -
0
votes1
answer221
viewsProblems accessing class attributes when creating java-based System action
Well I have a class that extends a JPanel, in that JPanel i add a JButton and use the method addActionListener to set a ActionListener for this one JButton, but when I’m creating the ActionListener…
-
0
votes2
answers1338
viewsHow to get id of an Imageview on android?
How I can get an id of an image from an Imageview. Example, for me to set an image in my Imageview I use the following code. imageView.setImageResource(R.drawable.icone_x); How do I do the reverse…
-
0
votes2
answers652
viewsCalling a function when a Fragment is closed
I have a activity who calls a fragment which is displayed in the form of a DialogAlert. But when that fragment is closed, need a method of Activity be called. What is the best way to do this? The…
-
0
votes1
answer101
viewsIs there any way to display a txt file without Jfilechooser?
Is there any way to display a txt file without Jfilechooser ? For example by typing the location of . txt file and connecting directly to Jtextarea
-
0
votes1
answer611
viewsCompare each word of the given text and save the lines in which the text appears
I have the following methods in java, the split method separates each word from a text and stores it in a Treeset<> to maintain the alphabetical order and returns the Treeset<> in…
javaasked 10 years, 3 months ago Lone_Dryad 43 -
0
votes1
answer42
viewsHow to implement generic data in this case?
I am using Ormlite in my application and want to implement a generic type in the following: public interface AdminDao extends Dao<T, Integer> { ... } where "T" would be the generic. Error:…
-
0
votes1
answer239
viewsHow to open an actitivity from a java Fragment
How to open an Activity after clicking on a Listview that is in Fragment, I am using: public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub…
-
0
votes1
answer117
viewsCapture Video and Audio
I’m building a program that interacts with the user, and I want to implement it in the same audio and video capture, but the only way I found it was with API.. Is there any way to capture video…
javaasked 9 years, 11 months ago user17270 -
0
votes1
answer103
viewsHow to use subclipsis in Ubuntu’s eclipse Kepler 14.04 64 bits
I’ve made all the settings indicated on the site: http://subclipse.tigris.org/wiki/JavaHL And when I access the menu Team -> SVN displays the following error message: Failed to load JavaHL…
-
0
votes3
answers121
viewsWaiting for remote audio extraction in Java
In my college project I have a small API in Java that extracts audio from video files, where is passed the URL of the video and is returned an MP3 file, so far so good. I would like to keep a server…
-
0
votes3
answers3234
viewsPicking up IP LAN for sending with ajax
I need to get the ip "LOCAL" (LAN) using javascript. I happen to have an application on my servers, but a client requested a customized service. I need to retrieve the client’s local IP address over…
-
0
votes2
answers947
viewsHide keyboard with Fragment
I’m making a mobile app that has screens on Fragment with Drawer, and in them EditText, but I’m having a problem that by clicking on EditText and then click away, or click the menu the keyboard does…
-
0
votes1
answer1850
viewsException when reading excel file using apache poi
I am trying to read an Excel (XLS) file, using the Apache Poi API, and am taking the Exception: java.io.IOException: Invalid header signature; read 0x0020000A000DFEFF, expected 0xE11AB1A1E011CFD0 -…
-
0
votes1
answer57
viewsGenerating objects with a certain value within a defined distribution
I’m having a hard time creating percentage-related goals. What I want to do is a method that generates objects, all objects have only one attribute. I need that 20% of the objects are generated with…
javaasked 9 years, 11 months ago leonardokbruksch 319 -
0
votes1
answer1332
viewsUploading files using REST and Java
I am creating an application and need a way to upload xls/xlsx files by sending the file from the front end (Ajax) to the back end (Java) so it can be manipulated. Ajax code:…
-
0
votes1
answer869
viewsHow to do basic mathematical operations?
I’m developing a Java calculator for a college job where it’s possible to do the four basic operations (addition, subtraction, multiplication and division), plus square root and square number, but…
-
0
votes1
answer561
viewsSorting method of a name array
I am trying to sort an array of names with this method, more when it has minuscule letter and Acentuo the names go to the end of the list, someone knows a method that sorts considering capital…
-
0
votes0
answers888
viewsWhat is the best way to show the External Quicksort simulation
I have to make one External quickSort simulator, showing for example the step by step of the same. Showing modifications to variables lower bound, upper bound, the main vector, the area vector(would…
-
0
votes0
answers80
viewsPointer error in a table fill method
Apparently it is to be right, but when I run the following errors: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at bibl.PesquisaSimpl.preencheTabela(PesquisaSimpl.java:188)…
-
0
votes1
answer390
viewsProblem with Getters and Setters of an Array
I’m having trouble accessing arrays in a Singleton class Class Info public class Info { private static Info cinfo; private String[] first_name; private String[] last_name; private String[] nickname;…
-
0
votes1
answer1170
viewsProtecting Source Code ( Encrypt .jar )
I have an application and would like to protect my source code, which is the safest and correct way to use ??
-
0
votes1
answer299
viewsHow to record multiple information in multiple classes using only one save class?
My problem is this, I’m developing a program that has several buttons that correspond to certain students, within each student I have personal information about and only this Student, I have a class…
-
0
votes2
answers1283
viewsGenerating dates , from a date entered and month quantity informed
I have to generate an automatic date from the date and quantity of month informed. Ex:Data digitada: 01/04/2014, Quantidade mês: 5 meses. Every time the year ends, it switches to the next automatic.…
javaasked 9 years, 10 months ago wellson.almeida 13 -
0
votes2
answers9331
viewsHow to change the Text Color of a listview?
I’m trying to change the color of the text of this listview that I did by following some examples on the internet, but the most I could was the comment from row 39* txt.setTextColor(Color.GREEN);…
-
0
votes0
answers99
viewsProblem with Jformattedtextfield when component leaves focus it returns last valid number
I have a problem regarding Jformattedtextfield when I add the mask and type in a valid number after I delete and write nothing in the field.. but when the component leaves the focus it returns the…
javaasked 9 years, 10 months ago RobertokurTI 1