Questions tagged as 'java'

1
answer

How to make a program in Java search in a certain information file and return a string

Hello. I have a program that would have to search in a text file like this: ovelha animal gato animal joão humano arvore planta I need a method, which receives a string, evaluates based on that file if that string is there, for example the...
asked by 22.10.2015 / 22:39
1
answer

Open Folder to select file

How do I open the file select box and only choose songs with the .mp3 extension? I'm using Windowbuilder but the menu does not provide such an option for quick build.     
asked by 25.10.2015 / 15:30
2
answers

I can not save to the database in a Spring MVC project

I'm going to explain the project because I believe that most people usually create the projects using XML, and I created the Spring MVC project by dismissing the files that configure the project as XML. The problem with my project is that I c...
asked by 21.10.2015 / 03:19
1
answer

Generating new objects using existing objects

I'm having a hard time doing this. Assuming I have two objects of type Person , which has the name and job attributes.    P1 (name = John, job = Taxi Driver)       P2 (name = Mary, job = Programmer) So I would like to generate the po...
asked by 18.08.2015 / 03:49
1
answer

How to load a URL that is inside a .txt by Web View?

It's the following, I'm making an application that is a kind of webBrowser. In this application, I have a url written inside a .txt, and I need to load that URL into my WebView. Here's what I've done: NOTE: I can already load a URL into my W...
asked by 15.02.2016 / 18:44
2
answers

Multiple sorts with ArrayList

I have a question. I want to sort the ArrayList person in different ways. <%@ page import= "java.util.*"%> <%! public class Pessoa implements Comparable<Pessoa> { String Nome; Integer numero; public Lista(St...
asked by 24.02.2016 / 14:58
1
answer

How to insert the size of an array according to user input?

How do I insert, asking the user through the class Scanner , the size of the array and it tells me the numbers of columns and rows you want, and then print the values, without using methods? I've tried but it's giving error: import java....
asked by 14.02.2016 / 01:23
2
answers

How to optimally read a list of ArrayList dependencies?

I have 4 classes, each class has a ArrayList , where the last element depends on another ArrayList : Example Genêro-> Artists-> Albuns-> Songs To read the songs I'm doing the following. for (Genero ge : objeto.getLista()) { for...
asked by 10.07.2015 / 22:59
1
answer

How to assign new value from SelectOneMenu to entity?

I have a table with several columns, among them I have one that is a SelectOneMenu , the table is loaded with a list of Inscricao . In the subscription status column I have a SelectOneMenu with the statuses: {"Solicitada...
asked by 06.07.2015 / 02:14
2
answers

What is the ForceBrute logic of trial and error?

How is it done to make the billions of combinations possible without loss of time? I made a random letter generation system (it can do all the combinations), but it loses a lot of time checking results already made by being random, and then I...
asked by 07.07.2015 / 18:52