Posts by Daniel Santos • 555 points
47 posts
-
0
votes1
answer22
viewsQ: Using Loginrequiredmixin with Login Formview
Basically, I have a Formview where I do validations to log users to my platform, if the result is positive, it is redirected to the URL /dashboard/, as shown in the code below. class…
-
0
votes1
answer108
viewsA: Heroku does not recognize my Django app
I managed to solve. What explains the project app being recognized locally but not in Heroku is that, although I didn’t make it explicit in the question, my file .gitignore was set to ignore all…
-
-1
votes1
answer108
viewsQ: Heroku does not recognize my Django app
I’m starting my studies with Django and created an application called core within the name Django project django1. After finishing, I decided to deploy it to Heroku with the following step by step…
-
-1
votes1
answer2457
viewsQ: Blocked cross-origin request - JS/CORS/AXIOS
I am using an API (Axios) to connect my application backend to frontend, however, I am not able to give POST (register a new record) on one of the pages because Mozilla Firefox blocks cross-origin…
-
0
votes2
answers103
viewsQ: Error giving python Mysql Insert
I have the table in my bank: create table tweets( ID_Tweet int not null auto_increment, ID_Candidato int not null, Conteudo_Tweet varchar(470) not null, constraint PK_tweets_ID primary key…
-
0
votes1
answer101
viewsQ: Constant click using Selenium does not work
Goal: Click 4 times on the same button "See More" Problem: Click command works the first 2 times, after that, it no longer works and returns TimeoutException Code: ops = webdriver.ChromeOptions()…
-
-1
votes1
answer90
viewsQ: Catch current time in Python
I want to calculate the execution time of a function in nanoseconds, thus: tempoIniAlg = time_ns() vetorOrdenado = quickSort(vetor) # Vetor ordenado tempoAlg = time_ns() # Tempo de resolução do…
-
3
votes2
answers73
viewsQ: Redirect: HTML or JS?
Commonly I see two main methods for redirecting the user to another page, being them: HTML: <a href="pt.stackoverflow.com">StackOverflow</a> and Javascript:…
-
0
votes1
answer185
viewsQ: Progressbar with Timer
I have an app with a Splashscreen where I have the ProgressBar barraProgresso. The goal is that once it is 100% loaded, open another form and close the Splash. The problem is that when there is a…
c#asked Daniel Santos 555 -
1
votes2
answers254
viewsQ: How to close all the Forms I want in C#
Let’s say I have 4 presses: form1, form2, form3 and form4. Knowing that the window form1 will always be opened first and when I give a .close() in form2 it, along with the others, must close. How do…
-
2
votes1
answer59
viewsQ: How to show in a query records that do not have a referenced datum
I have 3 tables: Person CREATE TABLE Pessoa ( ID_Pessoa INTEGER PRIMARY KEY IDENTITY (1,1), ID_Telefone INTEGER FOREIGN KEY REFERENCES Telefone (ID_Telefone), Nome_PSOA VARCHAR(50) NOT NULL,…
-
0
votes1
answer41
viewsQ: Limiting functions according to access level
I have the form MenuPrincipal and the FormLogon, where the latter, after carrying out the login validation queries, calls the Menu and closes. I need to limit some buttons and controls according to…
-
0
votes1
answer32
viewsQ: SQL error in casting int to string
I have a method where I need to return the ID (integer) of a particular record whose name I pass as parameter, but Visual Studio points out the following error : Undefined object reference for an…
-
0
votes1
answer95
viewsQ: How to inherit a form in c#?
I have an application with the form FormFuncionario. I wish to inherit all the features of this form for a second class, called ControlFuncionario, where it will be responsible for holding various…
-
1
votes1
answer59
viewsQ: How to detect when the mouse is pointing to a button
I have a form where certain actions will be executed only when a button btn have the mouse cursor on it, which button event I use ?
-
1
votes1
answer3156
viewsQ: How to add one Form inside another?
I have two presses (FormMenuPrincipal and FormFuncionarios) in which when the button btnFuncionarios of Menu is clicked, I want to open the form Employees. I thought I’d add one panel painel as…
-
0
votes2
answers2572
viewsQ: How to change button color using RGB or Hexadecimal code?
I have a Winforms application and would like to use colors that are not in the presets of the object Color, how could I do that ? By way of example: How the code is found: this.btnLogout.BackColor =…
-
0
votes1
answer2333
viewsQ: How to capture a key pressed in C#
I have an application with digit buttons and want to capture keystrokes and run the events of these buttons. I added an event of keypress in the window and tried to capture the typed key, but could…
-
3
votes2
answers979
viewsQ: How to get value from a database column using C#
I have a web application that uses these 3 tables: Client: CREATE TABLE CLIENTE( ID_CLIENTE INT PRIMARY KEY, CLIENTE VARCHAR(50), ENDERECO VARCHAR(50), CIDADE VARCHAR(30), CEP VARCHAR(9), UF CHAR(2)…
-
1
votes1
answer130
viewsQ: How to get value from a field in SQL using C#?
The idea is that I insert data referring to the same person within SQL, but in different Entities, contextualizing: I have the table Pessoa: create table Pessoa( ID_Pessoa int primary key identity…
-
5
votes1
answer2819
viewsQ: Using Switch Case for Ranges
My teacher passed an exercise in which we should use the cases of a switch to treat intervals, he strictly said that we should use the switch and we cannot use if and neither while/do. I’ve tried…
-
0
votes3
answers437
viewsA: Visual Studio INSERT command error
In my code there were two errors: 1- I was using the simplest variation of the INSERT command, where I would only need to specify the table and values (INSERT INTO TABLE VALUES (X)), and this was a…
-
0
votes3
answers437
viewsQ: Visual Studio INSERT command error
I have a web application in visual studio where I am getting the following message whenever I try to give an Insert command System.Data.Sqlclient.Sqlexception: 'An Explicit value for the Identity…
-
0
votes1
answer217
viewsQ: how to position a Jtextfield’s Caret?
I have a JTextField where opening and closing of parentheses is optional. However, whenever the user opens and does not close a parenthesis, my program gives error, because I use this text field to…
-
1
votes2
answers1841
viewsQ: How to treat division by 0
I have the code where there can be a division by zero: Binding binding = new Binding(); GroovyShell shell = new GroovyShell(binding); conta = shell.evaluate(conta).toString();…
-
0
votes0
answers96
viewsQ: Conversion of a calculation (String) to double
I have a String conta which is always a calculation (4+4, for example), and I want to pass this value to the resultado which in this case is a double, I’ve tried using the method parse, but I was…
javaasked Daniel Santos 555 -
0
votes2
answers130
viewsQ: Jformattedtextfield is accepting no characters
I have a window where we have a JFomattedTextField called txtQuantia, I applied a mask to him called mskQuantia, and set the valid characters, in this case, 0-9, but this field is not accepting any…
-
0
votes1
answer234
viewsQ: How to open a Jframe passed as parameter?
My idea is to open this window passed as parameter without it losing any attribute, for example, I have the class : public class Teste { JFrame janela = new JFrame; public…
-
3
votes1
answer421
viewsQ: How do I access the contents of a Jtextfield?
In a java project no connection to Database where we have only the layers Model, View and Controller, what would be the most appropriate way to catch a String which is contained in a JTextField of a…
-
0
votes1
answer84
viewsA: I can’t write in Jtextarea
Simple, it’s a semantic error, when you want to compare two String do not use the equality operator ==, and yes .equals(), remembering that String is an object, not a primitive type variable !…
-
0
votes2
answers586
viewsQ: Maskformatter leaving empty space
In my project, I have an age field, where I want to receive at most 3 number, so I did this : mskIdade = new MaskFormatter("###"); so far so good, but every time I type a number with less than 3…
-
2
votes1
answer576
viewsQ: In an MVC project, where should I leave the enums?
I am developing a program with MVC standard, I needed to create some enum, and left them in the layer Model, but I was in doubt about its location, which would be the most correct layer to house the…
-
1
votes2
answers168
viewsQ: Where to place comments and javadoc ? Model or Controller?
I’m doing an MVC program, but it’s time to describe in a javadoc what each window does, I was in doubt between putting these comments in the forms (Model), or us controllers of the respective…
-
1
votes1
answer490
viewsQ: Store values in inverted order
The objective is the following: read 10 values of a given vector, after that, create another vector, which has the same values of the first vector, but in inverted order, for example, the first…
-
0
votes0
answers115
viewsQ: Invalidate characters from a Maskformatter
So guys, I have a window where I need to go through a validation of null fields of several JTextField and a JFormattedTextField, where the latter has a mask for phone numbers "(##)####-####". The…
-
1
votes2
answers900
viewsQ: Enable Jbutton from selection in Jtable and remove the initial focus from the table
I have a window with a JTable, where only an entire row is valid, not just one field. The point is that the window already opens with the first line selected, and I’d like to disable that. In that…
-
0
votes1
answer1311
viewsQ: Enable and disable Jbutton
I have two JButton in my window, btnCalcular and btnConfirmar. The btnCalcular calculates some window values, and the btnConfirmar take these values and store them elsewhere. The point is that…
-
0
votes0
answers229
viewsQ: Add Jcomponents to a Jdialog/Jframe
So I have three JLabel and JTextField to add in one panel, and two JButton and a JTable to add in another panel, so that one stays below the other. I create a more generic panel (pnlPrincipal) to…
-
2
votes2
answers2905
viewsQ: Jtextfield null field validation
On my system, I have a window and a controller, but for some reason, it is never launching the error as expected : Method of validation : private void validacao(){ if((form.txtNome.getText() !=…
-
0
votes1
answer138
viewsQ: Numberformatexception in GUI
I have a program that simulates a pizzeria system, where the prices of the products are stored in enums as double. The JLabel from the window take these price values and present it on the screen in…
-
-4
votes2
answers456
viewsQ: Read an excerpt from a String
As you saw my question above, I want to pick up only one part that interests me from a String, for example, I have a String preco whose text is R$ 20,00, how do I take only the number ? Another…
-
1
votes1
answer441
viewsQ: Pick selected value from Jcombobox populated with Enum
I have at my window one JComboBox with items from an Enum, and a JLabel to show the value of the selected item in the combo. So far so good, I’m able to do this, only I’m a little unsure if I’m…
-
1
votes2
answers362
viewsQ: I cannot assign value to an Object Arraylist
It’s the following guys, in my project I have three different classes, one is a model (Client), one is the main, which has a Client arraylist, and another is a window. My intention is to register…
javaasked Daniel Santos 555 -
1
votes1
answer764
viewsQ: How do I initialize the centralized Jframe?
I’ve tried the this.setLocationRelativeTo(null); only he wasn’t in the middle of the screen, I’d say he was much more right and down than in the center. public Principal() {…
-
2
votes1
answer1603
viewsQ: Perform actions from the selected item in Jcombobox
I wanted to assign value to another class, whichever is selected in JComboBox. For example, if the "Active" item of a combo is selected I wanted to assign a value to a string from an external class,…
-
0
votes1
answer357
viewsQ: Formatting of data output
So guys, I was "futucando" in java, but I came up with a question. How do I format a number that is in a method? For example: Code snippet: JOptionPane.showMessageDialog(null,brand+ "Saldo atual de…
javaasked Daniel Santos 555 -
1
votes1
answer1902
viewsQ: I can’t get Joptionpane on Eclipse
Guys, I can’t seem to call JOptionPane in no eclipse class, tried in Netbeans, and ran normal. Someone there may know what might be? Error message: Multiple markers at this line - Access…