35,618 Topics
![]() | |
my dillema is i dont fully understand this assignment. I also dont know if my array should be inside of class or inside of the void setString method. help import java.util.Arrays; class String { //data members private int SIZE = 25; private [] myString = new array[25]; public void setString( … | |
hi . i need help.You are asked to implement a set of programs to simulate a group of users being logged onto a computer network. Users may be added, deleted, modified, displayed and searched for at any time. A method to test whether a user’s name is a palindrome (a … | |
public class J_01_FLOW_08 extends JApplet { JPanel p = new JPanel();//nedd a jpanel to add scroll String s_value[] = {"black","red","pink","yellow","blue","orange"}; DefaultListModel dlm = new DefaultListModel(); JList l_list = new JList(dlm); JScrollPane sp = new JScrollPane(l_list,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); JLabel l_label = new JLabel(); Container c; FlowLayout flow = new FlowLayout(); public void init() … | |
How can I extract the main classname of a java file ? I am doing this in php! I will read the whole java program as a string! Please help! <any_type/public/private/static> class **MainClass** { //Could be anything over here! public static void main(String[] args) { System.out.println("Hello World!"); } } | |
how can i implement a polynomial class using the doubly linked list data structure such that each node of the list holds the coeffient and the exponent of the term ? | |
Hello, I am unable to register the right key event from this program. Besides setting the focus of JPanel to the KeyListener, I am not sure what else can be done. I will be grateful for any help. Thank you! import java.awt.*; import java.awt.event.KeyListener; import java.awt.event.*; import javax.swing.*; public class … | |
hi Guys, I am currently coding for a GUI based program that delivers the amount of time a tutor works in minutes and the amount they go paid total, giving them details on the amount of time work total, and wage per hour and if it is below, minimum, or … | |
Hi.I created a jtable and imported a table from mysql there.now i created 3 jtextfield and 1 jdatechooser.Now i want to see the value of any row in the jtextfield and and jdatechooser when a row is clicked.I created the following method for this.It worked for the textfield but didn't … | |
I'm curious. Why is so much code in this forum formatted like this [CODE]if (something) { do something } else { do another thing }[/CODE] rather than [CODE]if (something) { do something } else { do another thing }[/CODE] The first version is harder to read and takes up more … | |
Hi all, A question asks me to write overloading functions to square,circle ,rectangle and triangle.... But since the square and circle have only one parameter I had to change the parameter of area of circle to double...... Is this the only way to accomplish this..... Are there any other ways … | |
import java.util.*; public class Elway { public static void main(String r[]) { ArrayList[] ls = new ArrayList[3]; for(int i=0; i<3; i++) { ls[i] = new ArrayList(); ls[i].add("a" + i); } Object o = ls; do3(ls); for(int i=0; i<3; i++) //insert code here } static Object do3(ArrayList[] a) { for(int i=0; … | |
I need your urgent help. Please help me to solve it out. Thanks a lot in advanced for your time. error: java.lang.StringIndexOutOfBoundsException: String index out of range: 150 Lines of code in this place there: if (text.length ()> 150) { text.replaceAll summary = ("<[^>] *>", ""). substring (0, 150) … | |
Hey everyone, iv'e been working on a Hangman code for weeks for the beginning of a semester long portfolio, iv'e tried several codes, but no matter what i do i can't seem to make it work... The specifics for the program were: - Create a list of possible words called … | |
Hi there, I've been trying for hours to get my Dijkstra algorithm to print the correct path. It collects the correct distance properly, but I just can't get it to print out the path of nodes that it uses! Any help would be great appreciated. 'route' is my string variable … | |
I've been doing this for the school assignment. So the whole idea of this program is to use random numbers to disguise a message by translating it into pairs of numbers; or to reveals messages by translating a series of pairs of numbers back in to the original characters. It … | |
Hey guys and girls, first post here been reading for a few days but I am pretty new to java and I have to edit a class to import a file into an array. The class initially defined the array within itself. So I made my changes and I am … | |
basically my program runs like this 1. open up configure GUI 2. get congiguration 3. close configure GUI 4. open up main GUI now when I am testing in netbeans, this works perfectly however, as soon as I compile and try to run the jar file outside of netbeans the … | |
i want to how when is my player is jumping, statding, or falling. for some reason it only goes in fall == true if statment. in my paint method iam printing different images. bc testing what is player is doing. i have main_class and player_class. //in player class public void … | |
I give the value of three reference types (Integer,String,List) to a function to change it. But only the value of List changed, but Integer and String are reference types too. Why can't I change their values too? public static void main(String[] args) { Integer i = new Integer(1); String s … | |
I am writing a java program that solves for program complexity using Halstead metrics. I just want to know what java keywords are considered "Operators" and "Operands" in halstead metrics. Any help from you guys will be appreciated... | |
I am working on a minesweeper project and everything is working fine EXCEPT for when you click on a cell and it contains a 0 (no mines around it) and it is supposed to open all the other "0" cells around it using recursion. Right now, I keep on getting … | |
import java.io.*; import java.io.Reader; import javax.servlet.*; import javax.servlet.http.*; import org.w3c.dom.*; import javax.xml.parsers.*; import java.net.*; import org.xml.sax.*; public class HelloWorldExample extends HttpServlet{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{ response.setContentType("text/html"); PrintWriter out=response.getWriter(); URL url=new URL("http://cs-server.usc.edu:10724/my1.php"); URLConnection urlConnection=url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); String xmldata; while ((xmldata = in.readLine()) … | |
I have been working on this method for six days without any luck. I should have talked to you earlier. This method is from the book, but it only is deleting California. I cannot figure out why. I tried a couple different methods(recursive and others) and none of them worked. … | |
I'm trying to load an image in an Applet.The code goes fine and the Applet Window starts but it just gives a blank window instead of showing the image.I put the html file,.class file and the image file in the same directory.Can u figure out where I went wrong?? Here's … | |
Iam trying to implement ternary tree in java but i have got exception in printnode method..i couldnot figure out the exception it will be great help if any one help me to figure out this Thanks in advance here is the the code exception Exception in thread "main" java.lang.NullPointerException at … | |
I see this example frequently and thought I'd give it a shot but I've got something unexpected happening with my Queue. I have multiple threads utilizing my producer class but the output doesn't show that it is being written to by each thread. protected Queue<ProductMessage> prodQueue = new ConcurrentLinkedQueue<>(); @Override … | |
All, I am working on a simple program that reads temperature, humidity, and dew point from a sensor and logs the result to a .csv file. I am using netbeans and using alt-enter to surround code with try-catch whenever netbeans suggests. The result is pretty ugly and I can't imagine … | |
AffineTransform tx = new AffineTransform(); tx.translate(0, 100); tx.rotate(233); tx.setToRotation(34, 333, 333, 222); g.drawImage(player_image, x, y, x+width, y+height, 50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1); not sure what iam doing wrong. this code below just display image g.drawImage(player_image, x, y, x+width, y+height, 50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1); now how can i flip it … | |
Hello, I'm having trouble with the ArrayList add method it seems to be giving me an error in BlueJ. It say's no sutiable method found for add(int) method java.util.ArrayList.add(int,Order)... And how would I create a new object inside a method which will add the parameters to the arraylist. Thanks Here's … | |
i create a program using java and jframe. now how can i put it on desktop so that i dont have to keep on opening eciplse to run the program. is there a way to put it on desktop with a icon. so i can click it any it will … |
The End.