Click here to Skip to main content
Page 1 of 1
Page Size: 10 · 25 · 50


Author filtered by: nameJulian [x]
Answer 13 May 2013   license: CPOL
I would suggest looking at RXTX Java Communication API. It is the one I use in my application and it works very good. I'm able to show all my usb ports.
Question 13 May 2013   license: CPOL
Hello. I would like to ask you a question. Is it bad practice to use threads in thread? Something like: Thread bigThread=new Thread(){ public void run(){ //do something here PersonalThread pThread=new PersonalThread();...
Answer 11 May 2013   license: CPOL
By reading your question I think that you want to add an image on your button. You could try something like this:import javax.imageio.ImageIO; //neededimport java.io.File; public void initialize(){ //create your jframe //add you panel to it //add your...
Answer 10 May 2013   license: CPOL
Use this code, I have written it myself and it works:import java.awt.BorderLayout;import java.util.ArrayList;import javax.swing.BoxLayout;import javax.swing.JCheckBox;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JPanel;import...
Need Help in Java JFrame by nameJulian
Answer 8 May 2013   license: CPOL
If you want to close your JFrame, you just need to call: this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //your main class must extend JFrame //or use this otherwise yourFrame.setDefaultCloseOperation(JFram.EXIT_ON_CLOSE);This ensures that when you...
Answer 4 May 2013   license: CPOL
Try using this code for your close, open, save buttons:public void actionPerformed(ActionEvent e) { if(e.getSource()==close){ this.dispose(); } if(e.getSource()==open){ JFileChooser choose=new JFileChooser(); //create a new JFileChooser instance int...
Answer 4 May 2013   license: CPOL
Is it giving you and IndexOutOfBoundsException ? If that so try the next thing: index
Answer 4 May 2013   license: CPOL
Reading from a text file, means that you must use a FileReader stream. I suggest that you use a StreamTokenizer, wich takes as argument the FileReader stream. And by using this StreamTokenizer, you can decide if there is a end of line( TT_EOF method for the tokenizer ) and a white space....
Answer 4 May 2013   license: CPOL
As a minor advice. Why have you initialized your text fields with so many space characters? If you want the text fields to be empty, the just initialize them like this: JTextField myTextField=new JTextField("");Thus the compiler knows that text fields must be empty. And by...
Answer 4 May 2013   license: CPOL
Two slashes is normal. JVM only takes one of them, because, as said above, one is the escape character. Take for example: Image myImage=new Image("D:\\image.jpg"); The program knows that it must access the file D:\image.jpg. Delete one slash and you should be ok.Best of luck.
Question 30 Apr 2013   license: CPOL
Hello there, I want to ask you people a question. Can a java timer be initialized in a for loop? So that the timer will once run once with a value taken from an ArrayList. Something like the idea bellow: void myTimerMethod(){ int size=ArrayList.getSize(); Timer...
Answer 22 Apr 2013   license: CPOL
Hi there, if you are using java 7 i suggest using a KeyboardFocusManager. Use it something like this:public class yourClass{ KeyBoardFocusManager manager; public void aMethod(){ //doing something with your frame in this method //like add components,...
Answer 22 Apr 2013   license: CPOL
Well i can't give you a full advice on how to work with your files, but as for the 2 vertical frame, i would rather use one frame. I would create a panel in it. To this panel i would give a GridLayout(1,2) (1 row, 2 columns ) and then add two more panels ( internal panels if your prefer...

Page 1 of 1


Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid