Questions tagged as 'java'

1
answer

How to print only numbers that are repeated between two different lists? [duplicate]

I have two lists of 50 numbers. One has multiples of 3 and the other multiples of 7 . Code: public static void main(String[] args) { List<Long> lista1 = new ArrayList<>(); List <Long> lista2 = new ArrayLis...
asked by 13.02.2018 / 00:07
1
answer

I can not import a project into NetBeans

I can not import a zip project into NetBeans. What is happening and when I go to the > File> Import Project> Zip is select the File and click on import it happens Oratthetimeofimportingitdoesnotrecognizethefileaszip,anditisinzipformat....
asked by 25.12.2017 / 21:20
1
answer

Error in code by classes

Good. I have now started to study programming in java that includes several classes in which one calls another. But I'm facing a mistake that I can not understand. I looked for similarly-coded codes and I can not figure out a clear error differe...
asked by 30.12.2017 / 23:46
1
answer

How to upload multiple images using spring boot

I'm developing a manga project and want to save several photos in the database. PagesController @RequestMapping(value="/pagina", method = RequestMethod.POST) public @ResponseBody ResponseEntity<PaginasEntity> cadastrarPaginas...
asked by 11.12.2017 / 14:27
1
answer

How to make a class to handle Graphics2D in paint?

In the following code I tried to create a Sprite class to manipulate the drawings, its function would be to transform the sprites into Graphics2D and use it in paint. But the only way I found to bind them was by doing this: public Sprite(Graph...
asked by 13.12.2017 / 02:55
1
answer

Add element in JList

This action of a button is to add the path of a file to a JList : private void bArquivoActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser fileChooser = new JFileChooser(); fi...
asked by 19.12.2017 / 00:32
1
answer

Exception in thread "main" java.lang.NoClassDefFoundError: org / apache / logging / lo g4j / LogManager

I'm trying to start a jar file and as soon as I run it, I get this error! Can you help me? C:\Unky\Web\BloodStrikeServer-master>mvn clean package -Dmaven.test.skip=true 'mvn' não é reconhecido como um comando interno ou externo, um progr...
asked by 29.07.2018 / 23:36
1
answer

Get span text from a site and return it to the console

How can I get a span of a website and return the text in the console? I tried this way, but I do not know how to get the Span: public void SpanSite(){ URL url = new URL("https://google.com.br"); BufferedReader reader = new BufferedReader...
asked by 02.12.2017 / 19:39
1
answer

Code hangs the window

I have this code in my game and check if it has passed 400 milliseconds, and then it updates. public void setUpdatePosition(int posicao, long tempo, int posX, int posY) { long previous = System.nanoTime(); Point ponto = new Point(tile...
asked by 27.09.2017 / 22:16
1
answer

How to get JSON values that OKhttp generated?

This is my code public void loginRequestAsync() { OkHttpClient client = new OkHttpClient(); HttpUrl.Builder urlBuilder = HttpUrl.parse("xxx.xxxx.xx.x.xx.xxx.x").newBuilder(); String url = urlBuilder.build().toString(); Reques...
asked by 21.09.2017 / 15:48