Posts by jsantos1991 • 2,397 points
80 posts
-
2
votes2
answers1023
viewsQ: Open local file from browser
Hello, What is the most correct way to open a local file (network-shared drive) through the browser? The file must be opened through a local application (desktop) previously installed on the PC.…
htmlasked jsantos1991 2,397 -
1
votes0
answers44
viewsQ: Add scroll bar to select in webbrowser
I need to change the properties of my webbrowser in javafx so that a scrollbar is available in select. By default the HTMLSelectElement is adding 2 arrows one at the beginning of the list and…
-
2
votes0
answers51
viewsQ: Javafx Webengine get content from an Iframe
I can’t tell when an Iframe is changed I use a listener to know whenever the page is loaded into the Webengine, however this listener cannot know when Iframe is changed/ loaded. Is there any way to…
-
2
votes1
answer2606
viewsQ: How to use java LOGGER
I set up the Logger in my main class. public static final Logger LOGGER = Logger.getLogger(DashBoard.class.getName()); and I’m using it this way: LOGGER.log(Level.SEVERE, "Error occur in…
-
0
votes2
answers70
viewsQ: File still in use by Java / How to close file connection
Problem: Code to demonstrate the problem: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.logging.Level; import java.util.logging.Logger;…
-
1
votes1
answer206
viewsQ: Javafx progress indicator in interface construction
I need to create a progress indicator so that the user has a sense that the program is running something from behind. Briefly I want to upload images to a TilePane grid gallery style, however when I…
-
3
votes1
answer225
viewsQ: Save frames/ images of a video
Hello, I need to save pictures/frames from a video. The idea is to create a preview of the film before it starts. The problem is I’m not being able to implement the examples I found. First example…
-
1
votes0
answers87
viewsQ: visulaizar PDF in java application - Embedded - Problem in rendering
Hello, I need to view PDF’s in my JAVA application. After some research, putting aside the paid components it seemed to me that the best answer would be this: Displaying pdf in Javafx The colleague…
-
2
votes1
answer209
viewsQ: How to insert a value into the prompt box?
I need to access a web page, through the component WebView. 1- I can load the page. 2- I can intercept the button event. I can’t insert/ inject var name = prompt("Introduza o numero:"); Note: The…
-
0
votes1
answer369
viewsQ: How to know the size of Jframe in the constructor?
I need to adjust the image size to the space provided by jframe. Error: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (0) and height (0) must be non-zero at…
-
0
votes1
answer93
viewsQ: Hibernate Mapping - One to Many/One to One/etc - Explanation
Basic example to understand how Hibernate mapping works. Table Person Sex table The mapping for these tables generates: Sex: public class Sexo implements java.io.Serializable { private Integer…
-
1
votes4
answers7295
viewsA: How to generate a spreadsheet from another using VBA
Check the following code... Missing implement the attribution logic of the respective column values Sub copyTemplate() Dim wk As Workbook Dim fileOriginal As Worksheet Dim lastRow, i As Integer Set…
-
2
votes1
answer393
viewsQ: Switching from Apache to IIS: how to display errors
I have a very basic web page (like a questionnaire), where at the end it stores the information in a Mysql database. While it was allocated to Apache (provided by xampp) it was working, now that…
-
1
votes1
answer3446
viewsA: How to import data from internet to excel vba
Follow the following code: Sub navega_cartola_fc() Dim ieApp As Object Dim Nome As String Set ieApp = New InternetExplorer Nome = "Botafogo" ieApp.navigate "http://www.scoutscartola.com/mercado"…
-
2
votes1
answer307
viewsQ: Heroku - Connect with mongoDB addon mLab
I need to connect to the Mongo database using the mLab addon. But I can’t enter or list when I run in local mode it’s working. I have the variable set: Any idea what it might be? My app.js var…
-
1
votes2
answers117
viewsQ: httpget + URI + Httpclient libraries discontinued. How to update code?
I need to access the API Panoramio to fetch some images according to the sent coordinates. However I am having trouble receiving the JSON value. After several searches, all indicate code identical…
-
2
votes2
answers1416
viewsA: How to create objects dynamically based on vector? (VBA/Excel)
At a time I needed I used this code, see if you can adapt for you. Private Sub UserForm_Initialize() i = 1 maxBoxes = 3 For idx = 1 To maxBoxes Set newBox = Me.Controls.Add("Forms.TextBox.1") With…
-
5
votes1
answer235
viewsQ: Bug in code, function repeats calling when opening excel file
Further to this question: /a/112899/13237 Code: Function PrinciQualidade14(LNumber As Integer) As String If LNumber < 15 And LNumber > 0 Then InsertPictureInRange LNumber,…
-
2
votes1
answer214
viewsA: Create add-in that associates number to an image
After several attempts I got to this code, I am no expert in VBA so any improvement please advise. Code: Function PrinciQualidade14(LNumber As Integer) As String If LNumber < 15 And LNumber >…
-
4
votes1
answer214
viewsQ: Create add-in that associates number to an image
I need to create a supplement (add-in) that associates a number to an image. Example: =getImageQualidade(1) 'e nessa célula ficava a imagem. I already know how to create/implement a basic…
-
2
votes2
answers2880
viewsA: How do I popup a new Jframe?
See if it’s something like this you want: import javax.swing.*; /** * JOptionPane showInputDialog example #1. * A simple showInputDialog example. * @author alvin alexander, http://alvinalexander.com…
-
3
votes1
answer894
viewsA: Array without repetition
If you want there to be no repetitions, before returning the value remove from the list: package DeclaracaoArray; import java.util.List; import java.util.ArrayList; import java.util.Collections;…
-
1
votes2
answers72
viewsA: Convert string in array format into an array and retrieve values
Make sure that’s what you want: (This code hasn’t been tested, but you might have some idea how to do it) String frase = "[ [ resumo: null ] [ datainicio: 2015-09-17T00:00:00.000-0300 ] [ datafim:…
-
2
votes1
answer989
viewsA: Problem with VBA and Internet Explorer integration
Checks whether it helps: Dim IE As InternetExplorer Dim ieDoc As Object Set IE = New InternetExplorer IE.Visible = True 'para verificar se abre o browser IE.navigate "http://www.minhapagina.com.br"…
-
1
votes2
answers602
viewsA: Update Jlabel with regressive count
As @utluiz said this is because your code runs fast, the value is changing but you can’t see that change because it’s so fast... Inserts this code line: Thread.sleep(1000); //faz com que o teu…
javaanswered jsantos1991 2,397 -
0
votes1
answer875
viewsA: How to count the number of comma-separated items in Mysql?
Check if this is what you want: LENGTH(fooCommaDelimColumn) - LENGTH(REPLACE(fooCommaDelimColumn, ',', '')) link…
-
4
votes3
answers14619
viewsA: java.lang.Noclassdeffounderror: Caused by: java.lang.Classnotfoundexception: When run . jar
In this case the problem was in the netbeans cache. This is the directory: C: Users jsan7os1991 Appdata Local Netbeans Cache 8.0 All files must be cleaned.…
-
4
votes3
answers14619
viewsQ: java.lang.Noclassdeffounderror: Caused by: java.lang.Classnotfoundexception: When run . jar
I am developing in Netbeans IDE when running through the IDE everything works fine but when I do clean and build and create . jar while executing casts me this exception: I tried to compile package…
-
2
votes3
answers4171
viewsA: Time in Java counting seconds in real time
I think this is what you want import java.text.SimpleDateFormat; import java.util.Date; import javax.swing.JLabel; public class relogio { public static void main(String[] args) { try { while (true)…
-
2
votes1
answer1150
viewsQ: Create graphical interface using Miglayout
I need to create this graphical interface: The last code I tried was this: (but the settings are not correct) frame.setLayout(new MigLayout("wrap","[grow]","[grow][]")); panelInfo.setLayout(new…
-
6
votes1
answer1189
viewsA: Comparing Ides to java
The differences between the Netbeans and the eclipse are very few, so this subject quickly turns based on opinions, however are here some specifications:…
-
1
votes2
answers2363
viewsA: Close all open jframes when opening a new one
I think this is the code you need: System.gc(); for (Window window : Window.getWindows()} { window.dispose(); // por vezes pode ser melhor usar setVisivel(false); } Heed: This code closes all…
-
1
votes1
answer253
viewsA: Autocomplete in jTextfield - adapt class
To answer your question: I’d like to know where I position the list of suggestions, because it is showing me very much on the textField. You can make that class change: AutoSuggestor In the method:…
-
15
votes1
answer10089
viewsQ: Difference between Integer.valueOf(String) and Integer.parseint(String)
I need to convert a String in int, and I came across these two options, which have an equal result. Is there any difference between them? Is there any rule/convention that says which to use or is…
-
1
votes1
answer300
viewsA: Handling components of a container
Forehead like this: Code: Component[] components = ConfUtilizador.ct3.getContentPane().getComponents(); for (int i = 0; i < components.length; ++i) { if ((components[i] instanceof JButton)) {…
-
1
votes2
answers3795
viewsA: How do I run a video inside Jframe?
If the idea is to use Java, with swing recommend using the library xuggler http://www.xuggle.com/xuggler , there are several examples implemented with this library. necessary 2 libraries Xuggler…
-
5
votes1
answer158
viewsA: Store <Integer,Integer,Arraylist<Integer>> in a collection
One possible solution is to create the class where you aggregate this data, and then create a list of all objects in that class. //crias a classe com todos os dados que o teu objeto precisa public…
-
3
votes1
answer551
viewsA: How can I create a 20-number Bet Card look in Jframe
Check the code, I think that makes it more practical than selecting the numbers by a combobox, to implement the rule of just letting 5 numbers be selected, but I think you can do this now. Code:…
-
1
votes1
answer649
viewsA: How to Import a . er1 File into CA Data Modeling
According to the search made the answer is Not, the CA Data Modeling (Community Edition) no longer supports the format .er1. Source is this thread: Link more properly this comment: Unfortunately, CA…
-
7
votes1
answer1595
viewsA: Browse Hashmap<Integer, Hashmap<Integer, Arraylist<Integer>>
You must do it separately, this is go through the main and for each iteration go through the secondary. code: for(Map.Entry<Integer,HashMap<Integer,ArrayList<Integer>>> kv:…
-
15
votes3
answers17342
viewsA: How to use more than one separation character in the split() method?
One possibility is: String a = "Exemplo, de. separar- string+ por* carater"; //Como quer todos os caracteres pode usar esta expressão regular: String[] parts = a.split("[\\W]"); for(String i:parts){…
-
3
votes1
answer45
viewsA: Inputdialog vertically
Your problem is you’re not wearing any layout: frame.setLayout(new GridLayout(x, y)); //x - é o numero de linhas //y - é o numero de colunas Example: import java.awt.GridLayout; import…
-
1
votes1
answer4021
viewsA: Read a TXT file, sort, and save a new Java file
If the words were one on each line, you can use this code: try(BufferedReader br = new BufferedReader(new FileReader("file.txt"))) { String line = br.readLine(); while (line != null) {…
-
2
votes1
answer478
viewsQ: Error org.hibernate.Lazyinitializationexception how to resolve?
I know this error is derived from trying to fetch some data from the database when I have no session open. But the biggest problem for me is that this error is appearing to me completely random, as…
-
0
votes2
answers1315
viewsA: Convert Empty string to integer to insert into database
Uses a if: int valor; if (JTextField.getText().equals("")){ valor=0; }else { valor=Integer.parseInt(JTextField.getText()); //aqui até devias de verificar se por acaso o texto não contem nenhum…
-
1
votes0
answers92
viewsQ: Save data in excel file through Outlook
I created a Rule, that every time an email arrives with a certain text on Subject executes a scrip, which has the function of going through the entire email and storing certain data in an Excel…
-
4
votes3
answers1337
viewsA: In what order is a Set stored? Random?
To complete the @Victor response The set by itself does not hold anything, since it is a Interface: Article on set here Imagery: In what order is a Set stored? Random? Yes Example: import…
-
2
votes1
answer596
viewsA: How to make the Combobox list bigger than Combo itself?
Be guided by this code: link: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.basic.*; /** * This class will change the bounds…
-
3
votes1
answer612
viewsA: How to put a Jlabel above the buttons on a Jdialog?
To change the buttons on JoptionPane you can use this code: JOptionPane.showOptionDialog(null, "Aceitas este codigo como correto?", "JoptionPane", JOptionPane.OK_CANCEL_OPTION,…
-
3
votes4
answers3475
viewsQ: How to return 2 variables of a function
I am accessing a webservice, that has as return: listProdutos[] -> List of all products or null when there are no products When you lose access for some reason, you make an exception, in which…