36,051 Topics
![]() | |
Hey, What I need to do is read a file- it will have a name and several numbers after, with -1 as a sentinel number to signal the end of line, ex: Rogers 15 22 6 12 -1 Myers 23 10 4 22 34 -1 ... .... ..... What I … | |
I'm making a text editor just because I feel like it, I know there are already good text editors out there and this one isn't going to be better but I still want to make one because, again, I feel like it. I'm using JFrame to make my GUI and … | |
Hello Members, The following Client.java and Server.java works fine: Client.java [CODE]import java.net.*; import java.io.*; public class client { public static void main (String args[]) throws IOException { Socket sock = new Socket(InetAddress.getLocalHost (), 2000); BufferedWriter dataout; String Message = "How are you?"; BufferedReader datain; System.out.println ("Sending "+ Message + " … | |
Hello Members, I have a JTextArea object containing a paragraph. Is it possible to bold certain words in it? A pesudocode or example code would be of great help. Thank you!! sciprog1 | |
Hello dear frendz!! My name is Mrunal Bhatt and I have worked upon a gesture recognition software in Java. It just needs a webcam and a nano projector. The projector and webcam are small and handy, so a user can wear them on their body and just use the projected … | |
[CODE]import java.awt.Color; import java.awt.DisplayMode; import java.awt.Font; import javax.swing.JFrame; class GameStation extends JFrame{ public static void main(String [] args){ DisplayMode dm=new DisplayMode(800, 600, 16, DisplayMode.REFRESH_RATE_UNKNOWN); GameStation game=new GameStation(); game.run(dm); } public void run(DisplayMode dm) { setBackground(Color.PINK); setForeground(Color.WHITE); setFont(new Font("Arial", Font.PLAIN, 24)); Ex7 s=new Ex7(); try{ s.setFullScreen(dm, this); try{ Thread.sleep(5000); }catch(Exception ez){} … | |
Hey! I need to add a child node (its name is stored in Object child1) to the specific parent node (Object hierarchy). To do that, I try to find the parent node and then add the child node to it. However, e.printStackTrace() provides the error message (see below). What am … | |
Hello I am a beginner in JSP and I wanted to include a Applet from my build/classes with the package chapter8 in my JSP file. What I have at the moment is: [CODE] <jsp:plugin code="MyApplet.class" codebase="../build/classes/chapter8/" type="applet" width="400" height="300"> <jsp:fallback> Cant load Applet </jsp:fallback> </jsp:plugin> [/CODE] Im running it from … | |
So the problem is to get two words from the user and then see if they cross and if they do type them out like the example: word1= lottery word2= boat Crosses would be: b lottery a t b o a lottery b o a lottery I am pretty lost, … | |
Hi! So, my question is how could I compare two objects. The code is shown below. The problem is that the first "if" statement is always true, even if it should be false. For instance, let's say childHierarchy[i] and hierarchy[0] are equal to 'Contract'. In this case "if (childHierarchy[i].toString() != … | |
I have no idea how to start the interpreter for this java project. I need some hint on the LET statement in order to write other code such as ADD, MINUS, GOTO...etc Thanks [CODE]public abstract class Statement { // execute() takes a ProgramState and executes this statement, by making // … | |
[COLOR=#555555]Hello everyone! [/COLOR] [COLOR=#555555][COLOR=#555555]Any help would be much appreciated![/COLOR][/COLOR] [COLOR=#555555]My problem: [/COLOR] [COLOR=#555555]I want to break up a string into separate objects.[/COLOR] [COLOR=#555555]Scenario: [/COLOR] [COLOR=#555555]I am reading a txt file into my program and I want to[/COLOR] [COLOR=#555555]separate the String in to separate categories. [/COLOR] [COLOR=#555555]String line = "BATHROOM TOI … | |
hey guys, im a bit new to this. pls assist me to correct this code :(. [code] public class studentSystem { public static void main(String args[]) { //Student sw = new Module(""); Student sw = new Student("Sefakor","1112348"); System.out.println(sw); System.out.println(sw.getName()); //prints Sefakor Selormey System.out.println(sw.getId()); //prints 1112348 sw.setName("May Stow"); System.out.println(sw.getName()); } } … | |
HI ... I m trying to make a form entry with input elements..I have an ADD button on the form besides a SUBMIT button..After the user enters the input fields & presses the ADD button, I want the form data to be displayed on the same form page. When the … | |
Write a program that will ask for a password. If the password is entered correctly, a message should be displayed like “You may enter”; otherwise after 10 tries display a count down from 10 to 0 then a message that the hard drive is being wiped out should be displayed. … | |
I am supposed to: 1. create two constructors. a. query for student's names and three scores. b. take four arguments 2. write a method calculateAvg that calculates and sets average 3. write a method calculateGrade that calculates based on 90+=A, 80+=B, 70+=C, 60+=D, <60=F 4. Write a method toString that … | |
In java code, when to expect to throw an exception with a throw statement and when to catch an exception with a try/catch block? Moreover, how to distinguish between a situation in which an exception should be caught by a method or throw to its caller. | |
Hello Members, Is there a way to remove the border lines of a JTextArea but retaining the JScroller? I tried the setBorder(null) method for the JTextArea without any success. Thanks a lot!! sciprog1 | |
I have this bit of code: [CODE]case 1: case 3: case 5: case 7: case 8: case 10: case 12: day = 31;[/CODE] Does this mean the values 3,5,7,8,10,12 can only be day=31? How can I make it so only the Max value is 31? So it can equal 31 … | |
Dear members, I am displaying table data using displaytag where i define [COLOR="Green"]pagesize=15 [/COLOR] the struts action that i use (along with the appended parameters) is: [COLOR="Green"]showAllTheArticle.action?user.id=1&user.username=admin [/COLOR] the table shows the first 15 record nicely, but when i click on the [COLOR="Green"]next/last[/COLOR] links- the following hyperlink generates: [COLOR="Green"]pages/AllTheArticle.jsp?d-49309-p=2&user.id=1&user.username=admin[/COLOR] - … | |
The Vehicle.java is the file that I am modifying. The second code is the testdriver. [CODE]public class Vehicle { String make; String model; int year; public Vehicle(String s1, String s2, int y) { if (y >= 1980 && y<= 2012) { year = y; } else { y = 2010; … | |
I need help with a project. The project utilizes the random number generator. What I have to do is get the player to set the min and max numbers of the game, and then a random number must be generated and the user has to guess what the number is. … | |
I need to verify that the number the user inputed is between 1908 and 2012. here are the actual instructions "The constructor must also verify that the value provided for "year" is at least 1908 and at most 2012 – if not, set the year to 2010 by default" I … | |
![]() | Hello, I need help on the NFLTeam program that uses an array on the number of players and their names. I've been doing an NFLTeam program where it prints the wins and losses of both falcons and steelers as well as printing out the number of players in those teams … ![]() |
Hi... I'm new here! does someone know how can i get a javascript variable from jsp? I've tried some ways but no one works! :icon_sad: please help! | |
Hello Members, Is it possible to have a Scrollbar for a JOptionPane as described below? [CODE]public class Hello { public static void main (String args []) { JOptionPane.showMessageDialog (".............."); } }[/CODE] If you can show me some pseudocode or a sample program, I would be very grateful. Thank you!! sciprog1 | |
I am hosting a servlet on my Tomcat server.. Have port forwarded and everything but it wont accept connections from a wan address.. i have used port-check sites to verify port and they show it as open.. but my jsp page on the server just cannot be displayed.. is there … | |
Actually, I want to make SEO(Search engine optimization) software in java ..any idea how i can start???Just like this or any link submission software... Given below is a software type that I am thinking of making.. [URL="http://www.seoelite.com/"]http://www.seoelite.com/[/URL] | |
I have a couple of classes in my app. So in one of them i use same int to make my life easier on the other one [CODE] import java.util.*; public class ObtainKey { public static void KeyAnalyzer() { int idx = 0; int tokenCount; String input; String inputArr[] = … | |
i want to make a java game . where can i start. i am intermediate at my java (i know threads, swing, generics).. do you know any websites or sources of information that provide project ideas and info on how to create games? | |
I am having a problem with displaying statement remove or not removed if letter is r | |
My assignment was to make a game called 'World of Warcrap', and I finished, but there are errors. the errors are in respawnNPC(), attack(), and fightToTheDeath() methods. here are the instructions on what each methods are suppose to do: 1) Define the respawnNPC method inside the WorldOfWarcrap class such that … | |
[B][/B] *hi there guys im new in this forum...i need your biggest help in my project....in java here's the input and output...:* Passing Score: 50% Input: Raw Score Output: Grade 74-below : Sorry you failed! 75-80 : Keep up the Good Work! 81-85 : Good Job! 86-90 : Great! 91-95 … | |
i am doing a project on barcode reader . i have just started it with a class pixelgrabber to grab the pixel,i mean grey value. And now i am confuse about how to distinguish the barcode part from other part of picture. plz suggest.. | |
what is the difference between the two String strHello2 = “Hello”; String strHello2 = new String(“Hello”); i have learned stings are immutable in java what does it mean? differnce between instance and class variablea and methods(in clear) pleae try to answer me. | |
Hello. I have an app (JDesktop) and it has the JMenu and some JMenuItems. One will build an JTabbedPane with a dozen or so tabs. I start that one and it works good. Another MenuItem builds another Internal Frame with JtabbedPanels it works too. When I go back to the … | |
how to do validationn of textbox for the following in swings using netbeans 5.5 1)only character 2)only number 3)only date 4)length of the text entered | |
hi,i was a beginner in java i have a doubt. we use import to use the predefined classes. we can also use package for importing classes. import java.lang.*; package java.lang.*; [B] what is the difference between imports and package at what time we have to use differently.[/B] plese try to … | |
Hi I'm new to Java and I was dealing with the creation of packages. Suppose I have the following two source files which I want to put in one package called [B]mypackage[/B]. The two source files are in the (Linux) directory: [B][I]/home/user/workspace/mypackage[/I][/B]. [CODE] package mypackage; public class HelloWorld { public … | |
Create an array of Strings, each containing one of the top 10 reasons that users like in programming with Java as listed below. Prompt a user to enter a number from 1 to 10, convert the number to an integer, and then use the integer to display one of the … | |
Hi I am new to java.I want to know the internal process during the conversion of source code to byte code and to native code in detail. Can anybody explain me that with clear architecture? Thanks & Regards Ilamathi P | |
Im wondering how do I correctly generate a random number in Java. Sometimes it gives me a negative, positive, very small range ,etc. Id like a simple formula that can give me some examples to control this better. Thank you very much. | |
Hi! My purpose is to fill the JComboBox from the database. The code shown below is working - it fills the JComboBox. However, the problem is that when I click on JComboBox to select some item, the error occurs. As I understand, String is casted to Object, and this is … | |
Hi Everybody I am trying to write a small game in Java. I have done few things. But now I want to add some more feature in it. I am creating Enemies in Game.java using UI.java and EnemyShip.java. Now I want [B]to determine how many enemies to create[/B] [COLOR="Red"]the number … | |
Hi, I'm working on a project where I have two classes, Divisions and SalesStats. I need to read in a text file from a method in SalesStats and store that data into two dimensional arrays to Divisions. When I execute, only 0.0 is coming out and not the numbers from … | |
I'll first give you a basic overview of my task, I'm working with Deterministic Context Free Languages. It's not really important if you don't know what that is, I've got that covered. I just need help on developing an algorithm. Basically I'm given an Axiom, which is my starting string, … | |
I have been trying to work on this for awhile now and this is the last part of 9 that I have to do for my project and I have come close but I just can’t figure it out. What I have to do: There is a banner ad at … | |
Hi I'm trying to draw a line in java using g.drawLine g.drawLine (int, int, int, int) || x1, y1, x2, y2 im trying to draw this : g.drawLine (xCenter + 200 * Math.cos(2 * Math.PI * 3 / 7), yCenter + 200 * Math.sin(2 * Math.PI * 3 / 7), … | |
So my assignment is to create a function in Java that takes out duplicate characters from the string. The catch is that it need to be done [B]recursively[/B] (no loops) and it must start like this with one parameter where the string is passed in. Please help guys I've been … | |
I've got a program that is supposed to mimic a music playlist by implementing a circular, doubly linked list. However, i cant use java's LinkedList, i have to write my own linked list. I have a DblListnode class to keep track of the nodes (show below) [CODE]public class DblListnode { … |
The End.