32,204 Topics
| |
I'm trying to get a square on a checkerboard to become highlighted when the user clicks on the rectangle. I created all my squares using fillRectangle methods. I'm not sure how to begin implementing this in the mouse adapter. Only the border of the square needs to be highlighted. Would … | |
Hello! I am about to load details from a file and save it to a node. I am having an error regarding to a certain code. Here's the code:: [CODE]boolean loadFromFile(String filename) throws Exception{ boolean b = false; try{ FileInputStream myfile = new FileInputStream(filename); ObjectInputStream in = new ObjectInputStream(myfile); do{ … | |
HI, Can any one know how to convert byte array into char array. For example : byte buf[]=teststr.getBytes(); Note: buf is byte array. I need to convert this into char array. | |
Hi all, I have a java swing based client server application. The GUI is in swing and I am using glass fish as my server. Is there a way or any software available to create an environment where I can test my application by creating virtual user connections so that … | |
Hello I am learning Java at my spare time as a hobby. It only been a week and at the moment I am trying to get my head around the following things fields, constructor, accessors etc. There is an exercise which I ma having trouble with: [U]Human [/U] 1. Create … | |
I wanted to create a java program usig arrays. The program uses the file to input student name, city, grades scores and gender information. From this information the percent and letter grade should be calculated. how do i start? | |
I am trying to figure out how to check for carriage returns in a string. I am reading file contents into a string variable, and need to check if x0D is present (carriage return). I have tried indexOf and matcher so far with no results. Any input would be helpful. … | |
hey guys, new to gui java. i found some code and have no idea what it does could somebody explain it to me please and help me understand how it could be changed it something more readable [CODE] try { URL url = this.getClass().getClassLoader().getResource(ref); sourceImage = ImageIO.read(url); } catch (IOException … | |
So I have to create a method that creates a custom arrow object and then returns it. No drawing is to be done in the method, it will be drawn once it's returned. I think I'm utilizing GeneralPath the correct way and then casting it to a shape properly but … | |
Hi all, I am pretty much new to Java (I've had experience in C++) and have been working on a "simple" FTP client. I pretty much ended up with the code below. Problem is I get a lot of errors mostly related to the IOException in each method. The errors … | |
hey guys, i am trying to create a simple menu using canvas for example [CODE] class Name extends Canvas{ MenuItem menuitem; public Name(){ JPanel panel = (JPanel) container.getContentPane(); panel.setPreferredSize(new Dimension(800,620)); panel.setLayout(null); setBounds(0,0,900,600); panel.add(this); setLocation( 0, 20 ); MenuBar menuBar = new MenuBar( ); Menu menuFarm = new Menu( "About" ); … | |
Hi, I'm trying to create a program that reads in a line of text. For some reasons, when I try to run the program, "Your input has ---- non-blank characters." comes up under every words. I want it to just come up once at the end. Any help will be … | |
I am trying to get a simple program to work were a image moves across the window. When my program gets to the void hop(int iStart, int iStop) method, repaint does not invoke a new paint. So all I get is a blank screen. How can I get repaint to … | |
hey everyone, i just started working with java graphical user interface, i found some source codes from the web and trying to play around with them and i am just unable to understand it fully, the code is well commented and easy to understand it is a simple game called … | |
branch between three sets of statements: One to display the numbers in descending order from the upper bound down to the lower bound (executed on character input 'd' or 'D'), one to display the numbers in ascending order from the lower bound up to the upper bound (executed on character … | |
I have 2 frames (classes exactly) customer & items... when a button clicked (button 'BUY') on customer frame it navigates to items frame. mean time i made customer frame [B]customer.setEnabled(false) [/B]. i called to item frame by simply creating an object of item class. then , when i coming back … | |
Hello again. :) I am comparing two nodes (some of my other methods need this method). I am having a problem with this method because it returns false even though both nodes have the same content. What are the problems of this code? Any suggestions? This is the critical part … | |
Hi all, I am working on a very simple EJB application in Netbeans 6.8 and EJB 3.0. Somethng wierd with the deployment.. I created a new Enterprise Application. But apparantly Build works fine but when i deploy it i get MODULE HAS NOT BEEN DEPLOYED MESSAGE and It Fails.. Am … | |
This is what I'm gonna do and I know I havnt got far, but have been searching on google for 5 hours and dont have the solution yet, Your little sister / brother asks you to help her/him with the multiplication, and you decide to write a java application that … | |
Hey i have a program thats due sunday and my teacher doesn't really teach that well....so i'm kinda confused and need help. problem: read a file of positive intergers and then print each lin and then print each number in the line (i've done this part) this is where i … | |
HI. I am going to store Enumeration in test file(notepad). After each sentence is over one rectangle box is coming. If any one have idea, how to remove that rectangle box. FOR EXAMPLE : [code]// twords is vector //tsenum is Enumeation //wstr3 is string FileOutputStream fw = new FileOutputStream(fileName); tsenum … | |
Which is the most efficient way of creating a string object in java? [icode]String s="helo";[/icode] or [icode]String s=new String("helo");[/icode] in terms of memory usage? Thanks in advance... | |
Hey everyone~! I am pretty new to threading but I'm trying to figure it out by playing around with its possibilities. I wrote a program where 2 threads are supposed to "race" to count to 10 and then the first one there says "I win!" and the second says "I … | |
i have a problem in my code when i go to the method add i successfully go there but i cant go back to the main method someone who can help about this. sorry for my bad english. here is the code: [CODE] package project; import java.util.*; import java.lang.String; /** … | |
Hey everyone~! I have been studying for the AP Computer Science exam, and I have a question where I think Barron's is wrong, so if someone could confirm whether I am correct or not please let me know! The following code snippets are given: [CODE=Java] public interface Player { /* … | |
Hi, I have an urgent ugly problem. I have a php file on a server that reads the name of the files of a directory from the server and POST them to my java application. When I try to read it, i get [CODE]Server returned HTTP response code: 400 for … | |
I'm not sure if this is the best way but I would like to display a list of addresses in a combo box where the columns come from different tables such as Countries, Cities and Types (work and home). I don't want to display the countryID or cityID, etc. but … | |
For Example: java is an object oriented language. it has many feature including 1.1 robust 1.2 inheritance. java is a interesting language. I need output as follows: java is an object oriented language. it has many feature including 1.1 robust 1.2 inheritance. java is a interesting language. Note: I need … | |
Hi, I have a project for Uni, It is to create a system which will allow fingerprint recognition which will allow a user to access a created database and download information to a screen. I have implemented what i want it to look like, now im working on 3 main … | |
Hi guys, why wont this work. I'm still learning and have no experience with graphics of any kind. Just trying to put the image onto the background. The link directory is right i think. [CODE] import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import javax.swing.*; //inc javax.swing.ImageIcon public class TheArea … |
The End.