Questions tagged as 'java'

1
answer

JSlider does not appear in JPanel after being inserted

I was trying to add JSlider to JPanel but it does not appear. Could you tell me where I'm wrong? import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import javax.s...
asked by 08.09.2017 / 19:48
2
answers

What is the behavior of a method that returns integer within if?

I have the following code for testing (Java language): public class Teste { static int n = 10; static int[] vB = new int[10]; public static void exibir(){ for (int i = 0; i < n; i++) { System.out.print(" " + vB[i]); }...
asked by 03.09.2017 / 00:28
1
answer

Failed to customize the javafx tab, the top edge of the panel does not appear

I would like the TabPanel area that does not have a tab to have a border as the image below. Currently my TabPanel is like this, no border to the right of "Enter" Iwouldlikeittolooklikethis,butIdonotknowwheretoputinstructionfromtheborder,...
asked by 12.08.2017 / 13:14
1
answer

Position JPanels vertically

I'm trying to add 4 panels so that they stay one below the other. So I decided to use BorderLayout , along with "positioning" ( NORTH , SOUTH and etc), passing index , however, it ends up jumping the second panel. Does...
asked by 16.09.2017 / 19:53
1
answer

Error sending files via Java Socket

Server.java package javaapplication48; import java.net.*; import java.io.*; public class Servidor { public static void main(String[] args) throws IOException { ServerSocket servidor = new ServerSocket(5656);...
asked by 15.09.2017 / 21:32
1
answer

Finding variable from another method of the same Class

I have a class BancoDeDados and it contains two methods: conexao and addDespesa . The conexao method connects to my local database. The addDespesa method adds values to one of my tables, but it can not "c...
asked by 16.09.2017 / 21:09
3
answers

Error in register "Do not recognize the property"

I'm studying Java EE and I came across a bug, if anyone knows the answer I appreciate it. I have my form: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"&g...
asked by 14.09.2017 / 07:14
1
answer

Convert base 10 to base 2

I'm trying to create an algorithm that converts base 10 to base 2. It's apparently converting, but it's not returning the right binary value. package basicojava; import java.util.Scanner; public class Ex13 { public static void main(String[...
asked by 15.08.2017 / 21:51
1
answer

javax.annotation.Nullable class not found

I'm using JDK 8 and I need to use the javax.annotation.Nullable library, but eclipse returns an error saying it does not exist .. Does anyone know how to get it or what version of the JDK does this library contain?     
asked by 25.06.2018 / 19:21
2
answers

Encoding without configuration: Eclipse (JSP) and VSCode

I have some issues related to encoding. Both in eclipse and Visual Studio Code are pointed to UTF-8. When I repair and save using eclipse, it works fine. But when I save in VSCode, encoding misconfigures. Here's an example: I use eclips...
asked by 27.06.2018 / 14:47