32,204 Topics
| |
I am writing a box program, with various extras. I understand that proper coding requires properties to be private, but I now need to add to this program getTotalEdgeLength, getSurfaceArea, and getVolume methods. Would I put these methods in the main class? I do not know a way to only … | |
[CODE] 1 // Fig. 29.24: RegexMatches.java 2 / Demonstrating Classes Pattern and Matcher. 3 import java.util.regex.Matcher; 4 import java.util.regex.Pattern; 5 6 public class RegexMatches 7 { 8 public static void main( String args[] ) 9 { 10 // create regular expression 11 Pattern expression = 12 Pattern.compile( "J.*\\d[0-35-9]- \\d\\d-\\d\\d" ); … | |
[CODE] if(e.getSource()==btn1) { paragraph=txtAreaArticle.getText(); if (paragraph == "\n\n") { return 1 && countPara+1; txtField1.setText(countPara); } } [/CODE] i wan set count how many paragraph for a article in my textArea. Then the number of paragraph will display on textfield. any one can help me? | |
Hello im kinda of new to java and i am stuck on a program. I want to take a word as input and display it in reverse. ex - hello to olleh I tried to do the For loop but i am kinda of stuck. Can anyone please help me! … | |
i am developing one application in which i should control the client monitor from server . so i am wondering java will provide anything to control the monitor display . if you can show some light on this topic plese help me. | |
I want to access search web services. For that i am having SDK file in ".java" file format. If i compile and run those files from command prompt i am getting result. But i want to achive this through browser. Is there any way to compile and run from browser?. … | |
Hi, I am trying to implement a client server wherein the client must be able to download a requested file off the server and upload a file onto the server. I have implemented the download part of the code using TCP Sockets. In the upload part from the client to … | |
[code] import javax.swing.*; import java.awt.*; import java.util.*; import java.awt.event.*; import java.io.*; public class PartOfSpeech extends JFrame implements ActionListener { private JButton btn1,btn2; private JTextArea txtAreaArticle; private JTextField txtField1,txtField2,txtField3; private JMenuBar jmb; private JMenu fileMenu; private JMenuItem out; public PartOfSpeech() { setTitle("PART OF SPEECH SYSTEM"); Container con=getContentPane(); con.setLayout(new BorderLayout()); jmb=new JMenuBar(); … | |
Hi, i'm making a class which runs on a different thread to the main class. I want this thread class to listen for keyboard events and then I will have specific action from there. The thing is, I don't know how to even start. I read that setFocus can only … | |
Hey! My problem is that I can't modify the "File name" label / text field programatically where you write the file name of your file in the JFileChooser. If I want to have "Write your file" written in the file name (by default) field how would I manage to do … | |
I need some help about how to connect MS Access database in NetBeans.I visited [url]www.netbeans.org[/url] but didnt got much help related to MS Access. What I did is I start from Net Beans Desktop Application ....But when i select the option of database in it ....It asks Database URL....I have … | |
I was wondering do all programs have a unnamed thread by default? For example, if i have a very basic program, can i put Thread.sleep(int) anywhere in it and it will make the program sleep for a set amount of time? | |
hello friends I want to gain some knowledge on java. could you help me in reffering some good e-books. Also let me know what is the best IDE to be used for java? thanks in advance. | |
If my application server(weblogic) is running in windows and If I try to view one of the JSP file which prints a lot of html data generated in the server side, I am not facng any delay. i.e in the JSP I have the following lines of code. <% String … | |
I am trying to figure out how to read a multi line txt file with a data like ranking, athlete name and Athletic sports name with two different year records like 2007 and 2008 like 1. JOHN CARTER in Sprint Race 19. JOHN CARTER in Sprint Race I am trying … | |
i am trying to give a authenticated login and password to java programme..but still there is some problems occur...how can i do this | |
I have a problem: 1.) How do you insert a sequence of integers into a binary tree? does anybody have an algorithm for it? like input : 1, 5, 3, 4 ,2 binary tree: 1 5 3 4 2 | |
[I] Name: The name of this question is rookie_question_System.out.println [/I] [ICODE] Hello and Thank you in advance for any assistance. [/ICODE] [U] [B] Purpose: [/B] [/U] [B] The purpose of this code is figure the best way to get values of variables as they are changing(simplest way). [/B] [U] [B] … | |
Hi, anyone knows how to use java jmf to get the client side screen resolution? The server and client are setup already but i just dunno how to automatically get the client's screen resolution. Thanks ! | |
I have 3 tables . the tables are connected with Foreign keys I want to delete some records but as they are interconnected by foreign keys i have to delete all of the dependencies. how to do this? | |
Hi, I have written the following code.I need to convert it to GUI. import java.awt.*; import java.applet.*; import java.awt.event.*; public class CompString{ public static void main(String[] args) { System.out.println("Enter two strings:"); BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter first string:"); String str1 = bf.readLine(); System.out.println("Please enter second string:"); String … | |
when i run a program, and try to type in a decimal as input i always get an error? what can be the problem? should i use int or double? help! | |
I don't know what's wrong with the following code. I keep getting the error: ']' expected Why can't I use boardsquare[k] and set it equal it to a graphic? What am I doing wrong? Thank you so much for your time and suggestions! [code] int k = 9; Piece[] boardSquare … | |
Hi all, Im fairly (very) new to coding. now I have this school project I need to do for IT which is due tonight. Basicly what I have to do is count the amount of words and letters in a string using what we know, which is not much... What … | |
hi all..i have a question ..and need help please... i have this applet code and i don't know how to use applets ....so i want to put this code in a single class if it can be made..coz i don't know anything about applets...and i want to join it with … | |
Add an interface, SizeComparable, that includes only the boolean isBiggerThan( Shape other) method. In your ShapeSet class, provide a method void sort(), that sorts the shapes of the shape set by class Shape implementing the SizeComparable interface. This is the problem I wrote codes but it gives run-time error.Could you … | |
Hi there, I'm writing a function to compare strings from two lists, but I'm facing problems comparing the two strings in an easy straightforward way due to my lack of knowledge in Java. I use Python more often which is way easier than Java in string manipulation and comparison. My … | |
hi guys i have a couple of Qs. 1.what is javadoc and how it works? 2.what [B]Strong typing[/B] means? 3.if we want to control the input ,it is better to use exeption handeling (try chatch),or a single is to control the worng input, whitch one is faster? 4.look at the … | |
Hi Everyone , Here JApplet Example of my own coding , I have do this for My first Assignment on Java Programming Course .. The Idea of Assignenemt is to Allow the user to enter the number of days that he want to collect it's Temoreature .. Then It start … | |
I am having a problem with my code (see below). The problem is with the line whitePiece[0].setX(boardSquare[j].getX); and the one below it (towards the bottom). Can't I use whitePiece[] and boardSquare[j] as variables? I can't figure out how to write this any other way. boardSquare is a variable from another … |
The End.