32,199 Topics
| |
Good day! I would like to ask on how to transfer the contents of JTable to mySQL database. I have seen a lot of codes of putting contents to JTable from database but I need to know the other way around. ^^" I do not have any idea on how … | |
| |
This is an attempt to stop the timer in this code: [Click Here](http://www.daniweb.com/software-development/java/threads/422817/how-do-i-stop-this-timer#post1805134) I just learned threads but I'm not sure if I'm using it right.. It doesn't have any erros when I compile it.. but it still doesn't stop the time. the clock starts when you enter "y" though.. … | |
OK, hello guys. I'm trying to make an image fit a JPanel. What I mean is to set a maximum size on a image, depending on how big the JPanel is. I'm using a JSplitPane to show some images. On the lef side I'm using a JList, and on the … | |
WHEN I put void in this method.. it says *"void type not allowed here"* in my if statement. but when I erase the void in my method.. it says *error: invalid method declaration; return type required* in the method... what should I do? public void setStop(int day , int hour … | |
import javax.swing.JPanel; import javax.swing.ImageIcon; import java.awt.Image; import java.awt.Graphics; import java.awt.Graphics2D; class View extends JPanel { Image icon1,icon2; public View(){ ImageIcon i1=new ImageIcon(this.getClass().getResource("tile1.png"));//image I drew ImageIcon i2=new ImageIcon(this.getClass().getResource("tile2.png"));//image I downloaded icon1=i1.getImage(); icon2=i2.getImage(); } public void paint(Graphics g){ super.paint(g); Graphics2D g2=(Graphics2D)g; g2.drawImage(icon1,10,10,null);//this image is not displayed g2.drawImage(icon2,200,200,null);//this image is displayed } } … | |
Plzz can someone help me where can i found good tutorials on xmpp using java | |
Hi, I'm a new java user, working on a brute-force knights tour algorithm in linkedlist. The move function worked perfectly (for a while), I mean, the pointer could move forward, or backward if a wrong path was chosen. But all of a sudden, it returned me a stackoverflow error. i'm … | |
I am trying to sort an ArrayList of Strings using the Merge Sort algorithm. However, I am having an error where it occurs on line 67 **`result.set(i,right.get(r));`** Where I get the IndexOutOfBoundsException. I have tried printing out the index of the result, and it seems to be that I am … | |
Please i've got problems reading from a recordstore(does not return any results when it reads any index beyond d deleted index) after calling the delete method with a specified index. Can anyone help? | |
Hello guys, i have a question regarding how to change the origin of a window, particularly a JFrame. I'm essentially running a program called "Fraps" to see the frames per second of my JFrame, with this program, you can display the fps on any 4 corners of the window currently … | |
Can someone please help me "write a drawTree method for the Turtle class" I am given the following information: World w = new World(); Turtle t = newTurtle (320, 480, w); The turtle will begin at the middle of the bottom of the World, facing North. Use the drawRectangle method … | |
When I am trying to design an algorithm , I had a programming problem in Java .. I want to write M nested "for" like that: for (I[0]=1; I[0]<=N; I[0]++) for (I[1]=1; I[1]<=N; I[1]++) ... for (I[M]=1; I[M]<=N; I[M]++) { Statements; } Where M is entered by the user during … | |
I m trying to create hello world example using rmi but till not succeeded.I got error in server file "Server Error java.rmi.ConnectException: Connection refused to host: 192.168.1.5; nested exception is: So please help me out. public class Server implements Hello { public String sayHello() { return "Hello World!"; } public … | |
I have created an application which puts all the images at a user defined location in a rtf document. The code is working fine and the images are getting inserted. However, if I open the document and add some text manually and save the file, the file size increases dramatically. … | |
I have this annoying problem: I am filling a HashSet out with Road objects, only doing so to avoid duplicate elements. However, the output from lines 81 though 95 shows that the set contains duplicate elements. Sorry for the messy code, this is a pretty ad-hoc sollution, in addition to … | |
I'm doing an actually simple practice problem from the book, but I am still not sure how to correctly do it.. It's just converting pseudo code. 1st part > num SIZE = 5 > > num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00 > > stack int validItems … | |
How can I keep the lines that have been drawn previously after calling repaint() this is my paintComponent public void paintComponent( Graphics g ) { graphics2D = (Graphics2D)g; graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics2D.setPaint(Color.white); graphics2D.fillRect(0, 0, getSize().width, getSize().height); graphics2D.setColor(Color.black); } I've another method public void show_line(line a) { graphics2D=(Graphics2D)this.getGraphics(); for(int i=1;i<a.getLine_segs().size();i++) { Point … | |
import javax.swing.JFrame; public class MainApp { public static void main(String[] args) { new MainApp().start(); } public void start() { CalculatorUI obj = new CalculatorUI(); obj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); obj.setSize(275,275); obj.setVisible(true); } } import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTextField; public class CalculatorUI extends JFrame { //Variables. … | |
I am basically trying to make a TicTacToe game in Netbeans GUI builder. I have nine(3x3) buttons to show a grid for the game and that's where you mark X and O's. I want to make it one player game. I wanted to know how to make an array of … | |
I have a jsp page which has post comment box. I have written a servlet which takes a comment from the text area for the comment box and writes the comment to the database and redirects all the comments stored in the database to the page for display(using request dispatcher). … | |
Hi, I created an application which allows a user to capture screenshots and save them as images at a pre-defined location. Now, I want to insert the saved images to a word document. I am aware of Apache POI, but that is still under development and it seems that you … | |
am trying to add images to a rtf document. I am able to add images to the document but I can't append any images. This means that when the 2nd Image is added, the first image is removed. I think that whenever the code is executed a new rtf document … | |
Hey everybody, New to the java scene and having major issues, it would be appreciated if someone could have a look at my coding and see where i'm going wrong. I have a few 1. When i press the 'start new game' button the random number resets but not the … | |
I am new to programming, I am trying to learn how to program in Java through some old programs I found online, and yet I seem to be struggling. This is the program I wrote to fill a linked list with 10 numbers using a loop and then just printing … | |
Hey all, I want to write an application that I can run from the console where it loads settings from a config file. I also want to be able to double click on the executable and obtain a GUI where I can specify settings that will be stored in the … | |
Hello, I go to Georgia State University with a Computer Science major. I was wondering what what be a good gpa to graduate with in order to put me ahead of the competition. Mind you Georgia State is my of the top 5 school in Georgia. Thank you | |
How do I search a linked list for a string ? findXX(string) , for instance. | |
I'm sure that there is an article on here already about this, but I didn't see it. I'm trying to make my java application executable so I can share it with friends but whenever I use eclipse to make it a jar or executable jar file and send it to … | |
mport java.awt.Color; import java.awt.Graphics; import javax.swing.JOptionPane; why this is not working need help public class NewClass { static String myBinary; public static void main(String[] args) { String code = JOptionPane.showInputDialog("Please enter zipCode: "); BarCode myBar = new BarCode(code); myBinary = myBar.getCode(); int length= code.length(); if (length != 5 && length!=9) … |
The End.