Posts by jsantos1991 • 2,397 points
80 posts
-
3
votes1
answer250
viewsQ: Multi-processing/Multithread not working
I want to try to solve the problem of when the client cannot connect to the server(connection failure, server below, etc). In my main class is the connection to the server and I want in case of…
-
1
votes1
answer909
viewsQ: Switch from Jframe to Jdialog
I created a frame of this genre: But, since it was to present that the client was having trouble connecting to a server, it was better to move to Jdialog Problem: I can’t make Jdialog visible Code:…
-
1
votes1
answer101
viewsA: How to prevent moving the cursor on a jFormattedTextfield with a mask?
Check this code: (has not been tested) [Part 1] MouseListener ml = new MouseAdapter() { public void mousePressed(final MouseEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() {…
-
2
votes1
answer783
viewsA: How to put an image in Jcombobox?
Code: import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import…
-
3
votes2
answers1393
viewsA: Macro, Capture MOUSE and KEYBOARD
Just to complete the @utluiz reply Some practical examples of the use of these functions: Uncontrolled mouse randomly walks by the screen: public static void movemouse(){ Robot robot = null; try {…
javaanswered jsantos1991 2,397 -
20
votes1
answer1351
viewsA: What is an ergonomic?
1) What is Ergonomics? Ergonomics (or "human factors") is the scientific discipline related to the understanding of interactions between humans and other elements of a system, and it is also the…
-
7
votes2
answers59
viewsQ: Additional field in a Database table for removal
I created a database, in which I have some problems when I remove some data from the table. Example Sales stand: I have a salesman who’s been fired and I want to remove him from the comic book but I…
-
1
votes2
answers375
viewsA: How to insert a jTabbedPane into a jPanel of another class
I honestly don’t quite understand what use you’re trying to make. But try something like this: public class ConfEmpresa extends javax.swing.JFrame { public static Container ct = new Container();…
javaanswered jsantos1991 2,397 -
9
votes3
answers388
viewsQ: Refactoring of a java class
I have a Java class that contains 1756 lines (obviously not all code, has blank lines, many comments and some commented code in case it is needed in the future) I’m implementing the structure MVC…
-
3
votes4
answers599
viewsA: Program Locking in While
This code can solve your problem. The source is this chatting, specifically at the end of the conversation. Code: import java.io.BufferedOutputStream; import java.io.BufferedReader; import…
-
1
votes0
answers205
viewsQ: Documentation of software developed
The file must contain: Explanation of the BD with Model ER Explanation of the Interface, Explanation of property files Use Case Diagram Creation (or other such that exemplifies all software progress…
-
4
votes1
answer241
viewsQ: Inner Join between two tables
I tried it this way but it’s wrong SELECT * FROM produto INNER JOIN familiaproduto ON familiaproduto.idfamiliaproduto = produto.idNomeProduto INNER JOIN qualitygate ON (qualitygate.idQualityGate =…
-
1
votes2
answers1749
viewsA: Draw a pixel-by-pixel image
It’s far from a good code, but you can get an idea of how it works at least. This code makes picks up the image then draw the pixel image by pixel at random In my test the image was 60 by 60, as it…
-
1
votes4
answers1224
viewsA: How to exchange data between a mobile(android) and another device through Bluetooth communication?
I didn’t test it, but it sounds like a good code of help: [Link] Code: package com.bluetooth; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Set; import…
-
5
votes1
answer905
viewsQ: Java use library . DLL
I’m having trouble creating the java interface, because I can’t understand the header of the function in C. Example Header function C: CMOEP_API char * CALLCONV CMP_GetLastError( ); Now in java I…
-
1
votes1
answer668
viewsQ: java.lang.Outofmemoryerror: Java heap space
I need help trying to clear up these 2 mistakes: Exception in thread "Thread-4" java.lang.OutOfMemoryError: Java heap space at…
-
2
votes3
answers392
viewsA: String contains a certain word
Possibly so: --remover todos os /n local result = string.gsub(s, "n", " ") -- remove line breaks --Depois procurar as palavras str = "This is some text containing the word tiger." if…
-
2
votes1
answer315
viewsQ: Collection Map<k,v> Methods
Doubts about the methods replace : compute : computeIfAbsent : computeIfPresent :forEach(briefly all who make use of the function or biFuntion within the input parameter) The replace is it really…
-
0
votes2
answers630
viewsA: Add days to a jDateChooser
When needed I used this function and worked very well: public Date somaDias(Date data, int dias) { Calendar cal = new GregorianCalendar(); cal.setTime(data); cal.add(Calendar.DAY_OF_MONTH, dias);…
javaanswered jsantos1991 2,397 -
3
votes1
answer1357
viewsQ: Dynamic graphical user interface in Java
I need to create something like this: I usually do the GUI’s with the help of the IDE but in this case I can’t(I think), because I need the GUI to repeat an undefined number of times, depending on…
-
2
votes1
answer837
viewsA: Does anyone know a good program to create mysql database?
I personally like to wear this: Mysql Workbench [Copied from the website] [Translated from google translator] Project Mysql Workbench allows a DBA, developer or data architect to visually design,…
sqlanswered jsantos1991 2,397 -
4
votes1
answer588
viewsQ: Jtable, add multi-lines[Cell span] +Format table
I need to do something like this: Right now I have a table like image 1, but I wanted to create a table like image 2. How can I create something like this? Any ideas? The closest example I saw was:…
-
4
votes3
answers2716
viewsQ: Is it possible to create a MAP<> within another MAP<>?
It is possible to create a MAP<> within another MAP<>? like this code: private Map<String, Map<String,Object>> mapTESTE = new HashMap<String,…
javaasked jsantos1991 2,397 -
2
votes1
answer131
viewsA: Passing an id to server socket
I’m not sure what the future use of the program is but if each client could enter with a name and you validated that name to never be repeated you had a good "ID" to manage messages. A few lines of…
-
0
votes2
answers914
viewsA: Consuming data from an external web service, how to instantiate the classes after the "import" of the WSDL?
My big doubt was how to instantiate the class, and then I’d be like this: RealtimeWebServicePortType ws = new RealtimeWebService_Impl().getRealtimeWebServicePort(); ws.lista_linhas();…
-
1
votes2
answers914
viewsQ: Consuming data from an external web service, how to instantiate the classes after the "import" of the WSDL?
I have no knowledge in WEB-SERVICES, this being the first time I’m using. After a lot of research I was able to "import" the WSDL file into java and with it "map" all classes of the Web-Service, but…
-
3
votes4
answers3679
viewsQ: Consume values from a webservice
I have no knowledge in the use of webservice, and I need to use one now to consume data from a database(Normally I would fetch the data directly from the database, but in this case the admin did not…
-
2
votes3
answers1558
viewsA: Jcombobox update from another Jcombobox
Without your code to help makes it a little difficult to help. Your combobox choice is fixed, this is know what is the element of each item? However, I’m going to post some sort of pseudocode to see…
-
2
votes1
answer438
viewsA: Excel button to choose
good Take a look at this code, see if it works: Private Sub UserForm_Initialize() ComboBox1.AddItem "Grains" ComboBox1.AddItem "Fruits" ComboBox1.AddItem "Dairy" End Sub Private Sub…
-
5
votes2
answers1295
viewsA: Customization of Jtextfields
There are some examples: The link where the code is http://java-swing-tips.blogspot.pt/2008/11/rounded-corner-jbutton.html Code class RoundedCornerButtonUI extends BasicButtonUI{ private static…