3,978 Topics
![]() | |
**i'm having the problem of capturing all the coordinate value of pixels while dragging with the mouse using mousedragged event in java** while i'm dragging slowly i'm able to get all the coordinate value of pixels but when i'm doing it fast i'm getting only one third of the pixel … | |
Hi! I'm a newbie in JSP and, therefore, my question could be totally incorrect. Sorry for this. So, I've developed a Java SWING application that is actually the image processing tool. Is it possible to update this software to a web-application? For example, could I place Java classes in WEB-INF/classes/, … | |
Hi all, I have to declare an array of LibraryBook objects and sort them either by title, author or page count, as the user requests. I've got the basics down but I'm missing something. [CODE]public class LibraryBookSort { public static void main(String[] args) { LibraryBook[] myBook = new LibraryBook[5]; myBook[0] … | |
[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import java.util.*; import java.net.*; import java.io.*; import javax.swing.border.*; public class userdetails extends JFrame { private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4,jLabel5; private JLabel jLabel7; private JLabel jLabel8; private JTextField jTextField1; private JComboBox jComboBox1; private JComboBox jComboBox2; private … | |
[CODE]import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.AffineTransform; import java.awt.image.*; import javax.imageio.*; import javax.swing.*; class ImageDrawingComponent extends Component { static String descs[] = { "Simple Copy", "Scale Up", "Scale Down", "Scale Up : Bicubic", "Convolve : LowPass", "Convolve : Sharpen", "RescaleOp", "LookupOp", }; int opIndex; private BufferedImage bi; … | |
i need help drawing an image in an applet for some reason it doesn't show up but there are no errors [CODE]package Game; import java.applet.*; import java.awt.event.*; import java.awt.*; import javax.swing.ImageIcon; public class AppletOne extends Applet implements Runnable, KeyListener{ int x_pos = 10; int y_pos = 100; int x_speed = … | |
Hi I'm in some serious need of help with a homework assignment. I have to write a program that takes a three word phrase from user input (through JOptionPane) and my code has to convert it to uppercase and then just take the first letter of the three words. here … ![]() | |
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.[CODE] String id= t1.getText(); int c1=Integer.parseInt(rc1.getText()); /* rc1 is a radiobutton */ statementobj.executeUpdate("Update tablename(fieldvalue) values('"+c1+"')where ID='"+id+"'"); [/CODE] | |
Hi, for some reason, my JScrollPane isn't working with mt JTextArea. Probably the most important part: [CODE] JTextArea TextArea; JScrollPane scroll; TextArea = new JTextArea(); scroll = new JScrollPane(TextArea); add(TextArea,BorderLayout.CENTER); add(scroll,BorderLayout.LINE_START);[/CODE] Whole code if you're interested in what I'm making: [CODE]import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.BufferedWriter; … | |
hi, i have no idea why this isn't working....I placed some system.out.println's for debugging purposes and what I found is that after entering the "new game" method, thethe message shows in the console, but then the random initialization occurs, after which I placed another system.out and its not showing which … | |
I want to load an image for each different shoe and I'm using JLabel to help me do this. I put the image's path in the JLabel constructor but when the code runs, it doesn't display any image. Instead of an image, the image path is written. appreciate any help … ![]() | |
Hi, I created a program using the linkedlist package. I encountered an error when I tried to insert an element... By the way here's my code... [CODE] import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.*; class guiListOperations3 extends JFrame implements ActionListener { static LinkedList <String> list=new LinkedList <String>(); static JLabel … ![]() | |
Hey, so I'll post what I have, the code is pretty self explanatory. I have a hunch that there are more efficient ways to code than using these long and repetitive if statements, so if you guys could help me in that direction that would be great. I also am … | |
Well i am working on a drink dispenser machine and got stuck on array part, this program includes selecting a drink, show price, show changes and a option whether to purchase drink again They are being placed on various method like public void A() select drink... public void B() calculate … | |
Hello, I have a JFrame, inside which is a JPanel, in which I am drawing lines in the paintComponent() function at an interval of 1 second. The screen always freezes. How can I change the program below such that I can see the lines being drawn after every second? Thank … | |
Hi All, I am writing a client server program that has quite a few GUI's in it. Basically, everything is working except for the problem I'm encountering. Well, obviously :P I am not currently running my server program in order to simulate what would happen to the client if the … | |
This is a very simple timer and I cant seem to get it to work I have tried this () runs but does nothing: [code] // The "Timer" class. import java.applet.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Timer extends Applet implements ActionListener { // Place instance variables here … | |
I am developing a tool using java swing. In it I have to read a .vbs file. I have used the following code for it. Scanner fileReader1 = new Scanner(new File(fileName),"US-ASCII"); while (fileReader1.hasNext()) { System.out.println(fileReader1.nextLine()); } where fileName is valid .vbs file path This is working only for .vbs files … | |
Help me in correctinf the errror i encounter here, i want the image file i have selected using Jfilechooser to be set on the image panel. i tried this but it failed: picthandler.setImageIcon(file); Here is the class Code , i have commented exaclty whr i want the bug to be … | |
I am a beginner JAVA coder, and yes this is a homework assignment for a online class... I am stumped, and cannot get help fast enough when it is 11pm at night :<) To better explain, I need to be able to have four methods. My first method contains all … | |
I am trying to create an applet for people to enter information, and the program should return a certain stat. However, after the user inputs all of the necessary information, no data is returned but this error message is: Exception in thread "main" java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991) at java.lang.Double.parseDouble(Double.java:510) at Player.toDouble(Player.java:110) … | |
Hi I'm in my first Java class, towards the end and am struggling with some code dealing with arrays. I'm not looking for the answers but am spinning my wheels (as usual) and am stuck on a particular problem. I'll list the problem here and then explain where I am … | |
I am making a game, but my buttons don't seem to be working. When I click in a certain area (where the button is) a screen should pop up. It doesn't. Please help. [code] // The "VirusMania" class. import java.applet.*; import java.awt.*; import javax.swing.Timer; import java.awt.event.*; public class VirusMania extends … | |
Hi! I try the following with a [B]javax.swing.JTable[/B]: - a custom TableModel (extending from DefaultTableModel) that allows adding/deleting rows by activating a checkbox in a [B]javax.swing.JTree[/B] - a [B]javax.swing.table.TableRowSorter[/B] (since JDK 1.6) that allows sorting the rows Initially, there is no checkbox marked within the JTree. So, the table model … | |
Hi, i have a desktop application that is developed using swing. We have created jnlp to access it from client side. But when jnlp opens, mouse not work properly. After some time it go on the top left corner. Could you give us some suggestion. Thanks in advance | |
Hi I need to animate user defined algorithms and I have a myGraph class. The dfs() and bfs() will go into the user-defined algorithm the user types and saves in a text-editor included with my program. I am checking the adjacency matrix to know if two vertex are connected by … | |
Well basically im creating a game for a school project and I am coding the Main Menu of the game right now but im having some very strange troubles when removing a JPanel and then replacing it with another. Well this actually works when I use a button to switch … | |
Hi! I would like to read XML file from my SWING application, however [ICODE]list.size()[/ICODE] returns 0. Why does it happen? Thanks! [CODE] private void open() { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File(openedFileName()); try{ Document document = (Document) builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren("Panel"); … | |
Hey guys! This is the code for a program I started today: [code=java] /* * IdeaCaptureMain.java * * Created on Jan 25, 2011, 4:33:45 PM */ package Idea; /** * * @author WolfShield */ public class IdeaCaptureMain extends javax.swing.JFrame { /** Creates new form IdeaCaptureMain */ public IdeaCaptureMain() { initComponents(); … | |
I have been doing an assignment for my my first year software course, in which we have to make a simple TicTacToe program in java. For the final 30% mark, we have to add a GUI in. Apart fro a tutorial only teaching me the basics (how to make boxes … | |
how we create a button using swing class..... I need help b/c I want to make a calculator but I am beginner and i dnt know swing class... Plz help me to create a button.....!!!!!!!1 | |
I could sure use some help. Here is what I have and it shows a problem which is : int tempCelcius = (int)((Double.parseDouble(tempTextField.getText())) (5 / 9) × (Fahrenheit – 32)); and here is all that I have: /** * * @author TJ */ public class FahrenheitConverterGUI extends javax.swing.JFrame { /** … | |
Hello! I have to make a "Dice Applet" for school. It is all finished but the dice pictures do not display properly. It only appears in a line (not the full image.) But they seem to display fine if you maximize the applet then restore the applet to its original … | |
Hi! I need my own file extension for SWING desktop application (image processing tool). In fact, I want a user to be able to save locations of JLabel components on a screen. Please, give me a hint on how to implement this task. Thanks! | |
Hello! I need to get some collision detection going in my code but I have no idea where to start! can anybody find out how to put this in? the detection will stop drwaing monstors if the bullet hits them [code] // The "SpaceShooter" class. //import java.applet.*; import java.applet.Applet; import … | |
i am doing project bandwidth efficient video simulation in java. I set class path in jdk set classpath=%classpath%;.\\lib\\gif4j_pro_trial_2.3.jar; [Ljava.lang.String;@15151aa Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation p roblems: The import javax.media cannot be resolved The import javax.media cannot be resolved The import javax.media cannot be resolved The import javax.media cannot … | |
Hello! I am a student and i have this assignment to do! I must create in Java a phone! Not a "working" phone just how it looks (sort of!!) I start it today and i have a few questions! I didnt do anything extraordinary, just create the outside and inside … | |
Hi! I would like to create a button for deleting all JLabel components on JDesktopPane. My code is shown below. The error message is shown below the code. For instance, let's say there are 3 JLabel components (the 4th is not JLabel). In this case, only 2 of 3 JLabel … | |
I,ve set up a JTable and want to populate it from an Access database useing jdbc odbc. The data returned is placed into an array but my problem is how to use the array results with... jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {list[0], list[1], list[2], list[3], list[4]}, }, new String … | |
I created a program that will display a question, then the user has to answer the question within a time limit. I want to make it so for long questions, the question will just go to the next line instead of cutting off. Is there another way to display the … | |
I am currently working on this graph "thingy" were I am told to produce 4 types of graphs. [LIST] [*]y=x2 [*]y=x3 [*]y=x*sin(x) [*]y=x*cos(10*x) [/LIST] Now basically, I have the GUI/Interface ready. I seem to have a problem linking the [B]y=x*sin(x)[/B] button in the PlottingWindow class to the PlottingPanel where it … | |
Can you help me in this program java applet. this is a program that the user will input one letter in all the textbox.When you typed all the letters correctly you will click the button and will prompt accepted else invalid. The letters in every textbox is fixed: A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,,W,X,Y this … | |
I am creating a Pool.java code for class final and all we need to do is to create a program that calculate the volume of the pool after the user enters the size of the pool. I have only one line where my code is giving me a error. The … | |
hi.. I don't know why the circle doesn't move .. [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MouseGameV2 extends JFrame implements MouseMotionListener { CircleClass a[]; Graphics gx; int m = 5; Thread move1; //---------------------// JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JPanel p3 = new JPanel(); … | |
I want to implement gabor filter in java. I got gabor filter code in Matlab. i tried to convert it into java but it had some mistakes. pls check the code and fix the errors. i post both the matlab code (which i got) and java code which i had … | |
I have this code which sorts any given number to ascending order, but I'm having difficulties figuring out how to sort the numbers given into a descending order. Code: [CODE] import javax.swing.*; import java.util.Arrays; public class sort7 { public static void main(int[]array) //public static void main(String[]args) { String str1=""; String … | |
GOODAY experts, this code was to display an image from the database but when I runs it it displays an empty page, I tried to extend using Jframe but it still display an empty page. in my EXCEPTION I tried using PRINT STACK TRACE nowhere. please help me to fix … | |
Hello, i'm a new member here in this forum.. and i think lot of programmers may help me here.. i'm a newbie also in java programming.. my teacher wants us to make a program that accepts 5 integers and then arrange it from highest to lowest.. i have an idea … | |
When I press the print Button, all it prints is a blank page. This is my code: [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.awt.Color; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; public class OptionWindow extends … | |
I am developing a tool using java Swing. I have used JFrame in it. Now I need to add a status bar into it so that I can easily identify line no in my jTextpane during typing in JtextPane. I am planing How can I do it? Can any one … |
The End.