Questions tagged as 'java'

1
answer

Simplify method using lambda expressions

I have this simple method: public void setComboBoxItems(List<User> users, List<Client> clients) { for (User user : users) { usersIds.addItem(user.getId()); } for (Client client : clients) { clientsIds.a...
asked by 15.12.2018 / 17:49
1
answer

Open a file with Java from a server that requires authentication

Good, I am trying to make an application in java, in which the program asks for the name of the document (in my case a pdf) and searches inside a shared folder remotely, if it exists, opens the pdf document . I am currently doing this as follows...
asked by 20.03.2017 / 21:00
2
answers

Convert Map to POJO

I have a map like the following: Map<MiObjeto, List<OtroObjeto>> and I want to convert it to a POJO that is defined in the following way: public class UnObjetoMas { private MiObjeto miObjeto; private List<OtroObjeto>...
asked by 23.03.2017 / 00:56
1
answer

about writing methods

I have the following code and when I try to write the method rellenarTipo I get an error, I have created a main class called main and another class called subclase that inherits main where when @Override is whe...
asked by 20.02.2016 / 16:00
2
answers

Program includes extension in name when moving files

I have a program in Java where when copying a group of files, when copying them, I copy them in the following way, this is the code of the method where you copy them: public static void copyFiles(String src, String dst) { int x = 0; eF...
asked by 25.02.2016 / 18:16
1
answer

GUI with arrangement

I have to make a window, enter some values and see them reflected in a panel, create the arrangement, but print the values that I have not set in null, I need to do two nested cycles, but I'm stuck and I do not know anymore how to do it. I pass...
asked by 04.05.2016 / 21:16
1
answer

Eclipse Java EE can not find javax.servlet?

I am setting up a new server, as always in a Eclipse Mars (4.5.2) Eclipse Java EE IDE for Web Developers , I had a problem with the installation of the server, I deleted it and found this bug that is already fixed, but now, when importing the...
asked by 11.05.2016 / 09:40
1
answer

Validate if the user is of legal age

I have an inconvenient I am doing a web app and they ask me if the user is over 18 years old can register and if no message comes out. The truth of javascript is very little. If you could help me I would really appreciate it, I leave the code of...
asked by 06.04.2016 / 03:06
1
answer

Detect F5 or reload and always send it home. JSF

I need to know if there is any way to identify when a user reloads the page using f5 or update the browser button to schedule an action and that it always redirects to the homepage. I am using a phase listener where I can compare befor...
asked by 24.06.2016 / 15:28
1
answer

Map from Java to Mongo an object with custom structure

I'm using a Mongo database and the backend with Java Spring. Originally it had this structure: "defaultActivation":{ "accounts": ["500026", "500027"] } And I mapped it with the following structure in Java: private Map<String, Set...
asked by 30.06.2016 / 22:24