36,051 Topics

Member Avatar for
Member Avatar for johnpt

Hi, Below line of code in my program is priting Date & Time in the format [B]11/3/11 4:33:13 PM IST[/B] , how can i print only the lines which are between spcific dates by using the above printed date format in JAVA. System.out.println("Date & time: " + akarray.getModifiedTime());

Member Avatar for NormR1
0
105
Member Avatar for canarian

Hello! I have size about 200*250 icon for my simple application. I need to put it inside on frame as (about) 40*40 size. But when i try everything (image icon, icon for JLabel...) but i could not re-size it inside on JFreme. I f i set the size as 40*40, …

Member Avatar for mKorbel
0
625
Member Avatar for Sbing

I cant figure out how to fix the "public class Triangle implements Measurable" i dont know what i am doing wrong to get this error.. i am not fluent in java but i never had this error before. i tried changing the name but in the process i get more …

Member Avatar for Sbing
0
160
Member Avatar for aanders5

Okay, so I did this not too long ago but I forgot the exact the procedure. Now, I think I was doing it all right after I set it up for Web Start, but when I went to Clean and Build to generate the files needed for online, I got …

Member Avatar for aanders5
0
203
Member Avatar for n1_razz11

hey i am currently working with java to do assignment. i dont know how to call form from menubar to open new form,,, so anyone can help......

Member Avatar for JamesCherrill
0
270
Member Avatar for TheComputerGuy

Just want to be clear, this is practice, not homework. I'm attempting to understand this a bit better...but I'm a bit lost as what to use for my test...and what exactly will help me get to the base case. Here is what I have so far [CODE] public class int …

Member Avatar for JamesCherrill
0
2K
Member Avatar for geekman89

Hello I need help with a program I want to make a method that takes a String and uses the text in that String to use a method from an object. Something like this: public void doThat(String text) { myObject.text();// Where text is the actual text stored in the String …

Member Avatar for JamesCherrill
0
188
Member Avatar for onyx112

So I'm trying to create a program that will take values from one array and multiply them with the values in the second array and then allocate the answer into a third array, then returning that array as a result [code]import java.util.Arrays; public class ArrayCreator { public static void main( …

Member Avatar for JamesCherrill
0
123
Member Avatar for apcxpc

'ellos So I'm making a Hangman game, and for the sake of completeness I want to have a HELP feature. When the Help button is clicked, a browser window should open up (not *within* the game frame... but just generally) and display the HTML Help file. How do I do …

Member Avatar for masijade
0
725
Member Avatar for dennysimon

hello all using ComboBox has it own backward,if the Item are too much ,then the combobox will become very tall (when it call) the other way is using textfield.Which will show selection ,only the items which have the same fist item's Letter with the one we type in. The question …

Member Avatar for dennysimon
0
87
Member Avatar for begprogram

i have to create a DigitsDisplay application that prompts the user for a non negative integer and then displays each digit on a separate line like such "Enter a positive integer: 789 7 8 9 this is what i have so far Can someone please help me fix this program …

Member Avatar for adarshcu
0
149
Member Avatar for je5ter461

below is my current code for a math game i'm having problems creating the answer checking part of it, any assistance is appreciated. [code] import javax.swing.*; import java.util.Random; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Event; import java.awt.event.*; import javax.swing.*; public class MathPanel extends JPanel { // Declares Labels and …

Member Avatar for je5ter461
0
210
Member Avatar for jackmaverick1

For some reason the file that I input into my GUI isn't being found by Java even though windows explorer finds it just fine. If you'd like to see a specific part of the code, just ask! Thanks in advance, Jack

Member Avatar for jackmaverick1
0
9K
Member Avatar for DaniwebOS

Originally I had the program all in main but I wanted to separate this by having the comparison method (diamond of asterisks) in its own method. For some odd reason I'm getting weird errors that won't allow the program to run. Errors below: 1) Systan error on token "," delete …

Member Avatar for DaniwebOS
0
297
Member Avatar for mehnihma

My question is ; how to take a value from a loop and continue the loop and take the new value again, print it and add it to the old one? thanks [CODE] while (numCourses <= 3) // loop 1 times { System.out.print( "Enter grade (one character): " ); // …

Member Avatar for thines01
0
117
Member Avatar for revjim44

I'm new to Java (2 weeks) and was given a class assignment to create a program that takes a 5 digit number and checks to see if it is a palindrome (same forwards as backwards.) The requirement stated to use the methods main(), retrieveInput(), check(), and display(). My code works …

Member Avatar for hfx642
0
218
Member Avatar for caswimmer2011

Hey, I am having trouble compiling in netbeans. When I go to compile, I usually go to Run>Clean and Build Main Project (or shift F11). When it compilies, it says Copying 1 file to /Users/me/NetBeansProjects/JavaApplication11/build Nothing to copy. And when I go to run the .jar file, it doesn't open …

Member Avatar for caswimmer2011
0
370
Member Avatar for Majestics

I am working on packet analyzing software, so i just need a kick to start by reading the packets of wireless, but i dont have any idea regarding to it... Any who handled such kinds of projects before please help me a bit....

Member Avatar for joehms22
0
112
Member Avatar for ceptic

basically i have a online game underway all php based what i am trying to do is create a client which the user can download and basically run the game from there desktop. the site runs mysql latest version. but what i really want to know how to do is …

Member Avatar for joehms22
0
91
Member Avatar for thorin

I am new to JSP and I am not very familiar with what its advantages and disadvantages are. We all know that Java is a big and complicated language, but it's not as web oriented as PHP. I have also heard that it's more expensive to find a server for …

Member Avatar for peter_budo
0
156
Member Avatar for Ibanez1942

I have a java code that i don't know what is the problem. could you help me? On"Stock testStock = new Stock();" I get an error message that says " Stockcannot be resolved to a type." import java.util.Scanner; /** An application class to test Stock class */ public class StockTesting …

Member Avatar for Anyday
0
342
Member Avatar for dennysimon

hello all how is the code to move the cursor from textfield1 to textfield2 right after key "enter" pressed ? thank you denny

Member Avatar for JamesCherrill
0
121
Member Avatar for canarian

Hello! I am writing a java program. This application will work on very slow computers too. 1) My application prints on the command line logs about what action did the user. Sometimes one action needs to write 50 lines on command line. Sometimes 2-3 lines... But these 50 lines are …

Member Avatar for adarshcu
0
88
Member Avatar for Erlendftw

Hello there Daniweb community, i am creating a 2d game in Java, however i have a problem. I googled up KeyListeners for JFrame, as they didnt work as usual, and i found out that when using KeyListeners with JFrame you have to set focus, right? Well. I have Googled abit …

Member Avatar for Erlendftw
0
151
Member Avatar for bombay1982

When I am trying to create Stateless Session Bean in Eclipse the finish button is not working(is not highlighted). Please find picture attached. Anybody knows why ? I tried many different options, looks like bug in eclipse. I showed that to friend of mine who is experienced ejb programmer and …

0
87
Member Avatar for Depsi

Hii all, I have an assignment in my java course and i just did the required 1 , and the else is very confusing for me , I'll be very appreciate if any one could help me for 2nd required and then ill try again in the rest . <URL …

Member Avatar for Depsi
0
137
Member Avatar for MrHG24

Hey guys, I have been having a problem with converting an interger into string for input purposes. For example, I am trying to make it so when the user inputs his/her name and it is an integer the program will not accept it. The IBIO file is the input method …

Member Avatar for jackmaverick1
0
184
Member Avatar for SasseMan

Hi! I'm looking for a way to make an application (app1), separate from another java application (app2), that can acces the GUI of app2 and also listen to all events that are passed to app2. I would like to be able to get hold of the frame of app2 so …

Member Avatar for jackmaverick1
0
155
Member Avatar for scarletfire

HI I was wondering what is wrong with this piece of code as it compiles but then it prints java.lang.null exception in the terminal. and it prompts the red line. I am basically trying to create a ticketoffice class that would store information of 3 users who are only allowed …

Member Avatar for hfx642
0
126
Member Avatar for pikalife

how do you write the "go to" command in java? like a command that allows me to go back to a previous part of the program and rerun the program in a loop?

Member Avatar for hfx642
0
8K
Member Avatar for Dancer90

I am doing a project in class for computer science. I have to make a hangman game that consists of the following: Get the words from a file and pull in the next word after each game, display the word as dashes for the user to guess, prompt the user …

Member Avatar for joehms22
0
377
Member Avatar for Tsuchino

Hi everyone, I'm a fairly new Java student and I need some help regarding subclass. This is what I'm trying to do: Basically, I created a Superclass called Person, and from it I created a subclass called CollegeMember. Now, I need to divide the CollegeMember subclass to "Lecturer", "Student" and …

Member Avatar for Tsuchino
0
103
Member Avatar for j23

hi, how do you get the html file to run the java applet in a webbrowser. I need to have a html file which will allow me to view this applet in a web browser. im using eclipse to write the code for the applet. [CODE] import java.awt.Graphics; import javax.swing.JApplet; …

Member Avatar for Taywin
0
192
Member Avatar for mrgadgets

I want to start develop software in both Java and C++. I am previously develop app for website so I am really not familiar with desktop programming. If we do code in Java, I believe we need a development tool with GUI so which one is the widely use nowadays? …

Member Avatar for Ezzaral
0
107
Member Avatar for prabhjitsw

Hello Everybody ! i have a few questions for u I have already made an appointment booking website on PHP using PHP Designer as editor and on WAMP platform, i run it on localhost. The website consults Database and puts forward the times available and lets users fix appointments and …

Member Avatar for chrishea
0
257
Member Avatar for dave013

think of a number and allow the user to guess it [code]import java.util.*; public class ThinkNumber { public static void main (String args[]) { //generate number in range 1 - 100 //prompt user to enter guess //loop until correct number is guessed //check guess and output hint //guess is correct …

Member Avatar for strongguy12345
0
134
Member Avatar for bbman

Hi all, here's a kinda bullet-pointy explanation of what i have - I have a simple JFrame - I create a JPanel called 'ContentPane' [CODE]contentPane = new JPanel(); contentPane.setBackground(SystemColor.window); contentPane.setBorder(new LineBorder(SystemColor.inactiveCaption)); contentPane.setLayout(null); setContentPane(contentPane);[/CODE] - the JFrame has a [CODE]JMenuBar -> JMenuBar -> JMenuItem[/CODE] - The JMenuItem has a MouseListener and …

Member Avatar for JamesCherrill
0
167
Member Avatar for geekman89

Hello everybody. I am in need of an answer. How can I use the text from a string and use it as a variable's name? For example: I have an array: int xyz[] = new int[5]; And say I want to check if it's name is the same as a …

Member Avatar for geekman89
0
501
Member Avatar for canarian

Hello! I need to ask password to user, to get administration rights for my java application when it works under linux (or any POSIX). Can someone help me about that? Thank you!

Member Avatar for Taywin
0
95
Member Avatar for vijaykavin10
Member Avatar for vijaykavin10
-2
94
Member Avatar for Joey_Brown

Hello; I have a following method that allocates memory for some objects. [CODE] public static int formStyleOfLyle(int a) { ObjectL[] numberL = new ObjectL[a]; if(numberL==null) { return -1; } return 0; } [/CODE] I really dont know what this does; but I need to check the return value of this …

Member Avatar for Joey_Brown
0
127
Member Avatar for Yutxz

My program receives no errors or run time errors, but for some reason it runs infinitely. I need help pinpointing the problem D: I will post additional information about the exercise I am trying to solve in this thread. [CODE] package captcrunch; /** * * @author Josh */ public class …

Member Avatar for JamesCherrill
0
219
Member Avatar for Pravinrasal

I want to increase column width automatically when record is added or record fetched from database in jtable in java.

Member Avatar for JamesCherrill
0
88
Member Avatar for ashley808

I've never felt like a total moron until I took a Computer Science class. I'm trying to create a program that rolls a pair of standard 6 sided dice 10,000 times and outputs how many times doubles show up, using a "while" loop. I think what I'm trying to do …

Member Avatar for JamesCherrill
0
761
Member Avatar for ali11

I have no idea what wrong my cods when I press = button of my calculator nothing happens. [CODE]import java.util.Stack; import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; import java.util.Vector; public class Ahsan extends JFrame{ Stack s = new Stack(); private JFrame f; private JPanel p1,p2; private JTextField …

Member Avatar for JeffGrigg
0
767
Member Avatar for jinglylime

Hi, I'm having trouble with setting up my table. How do i get the header to show initially. I want "code", "Number" and "Value" as the header. And I want to know if the way i added the table is correct? Can you help me please. Thank you! [CODE] import …

Member Avatar for mKorbel
0
97
Member Avatar for TheHelp

Hi, I'm learning java and I have a problem. The getText() doesn't seem to work. What I am trying to do is to write a simple code, where I assign the text of a button to a string variable and print that string variable on the command line. I get …

Member Avatar for TheHelp
0
95
Member Avatar for Dmiller071

Hi all, I'm working on a maze project with different types of robots. One of the robots is supposed to be a right-hand-rule robot which follows his right hand. The way I'm coding it so far, is I have an Enum Orientation. If the right hand is facing UP, DOWN, …

Member Avatar for Dmiller071
0
1K
Member Avatar for sidra 100

hi i have made a program to find average and standard deviation. n it read input from other. rest of things are fine plz guide me my output for Standard deiation sD comes NaN. i have searched alot bt couldnot find solution my code is [CODE]import java.io.*; import java.util.*; public …

Member Avatar for Taywin
0
170
Member Avatar for yapaarachchi
Member Avatar for TheSomalilander
0
226

The End.