36,051 Topics

Member Avatar for
Member Avatar for sam1
Member Avatar for Phaelax
0
169
Member Avatar for Yustme

Hi, How do i align text to the right in java? Default its from left... Thnx in advance!

Member Avatar for server_crash
0
83
Member Avatar for Phaelax

I'm trying to find all quoted strings in a given text so that I can apply proper highlighting. I've tried various regex but can't seem to get the results I want. [code] String line = "a big \"yellow\" dog! And a \"purple\" bird!"; String[] tokens = line.split("\".+\""); [/code] That cuts …

Member Avatar for Phaelax
0
97
Member Avatar for Yustme

Hi, Im having a lil problem which is kinda fustrating me. This line of the code: g.fillRect( xPos, yPos - 20 - sensor[i], 20, sensor[i] ); the last sensor[i] besides how high the rect will be. And in this case that would be 1, 2, 3, 4, 5, 6 and …

Member Avatar for Yustme
0
525
Member Avatar for hahagal

I am new to java programming. I kept getting this problem cannot resolve symbol. I really don't know what went wrong. I am using J2SE SDK 1.5 and jGRASP 1.8.3. The code are below. Hope I can get a reply ASAP. Thanks.. [COLOR=#0000ff]1 [/COLOR][COLOR=#941edf]import[/COLOR][COLOR=#000000] java.util.Scanner; [/COLOR][COLOR=#0000ff]2 3 [/COLOR][COLOR=#941edf]public[/COLOR][COLOR=#941edf]class[/COLOR][COLOR=#000000] Pay [/COLOR][COLOR=#0000ff]4 …

Member Avatar for aniseed
0
182
Member Avatar for provenshop

Where can i download all Java advanced tutorials in Java sun .com i want the specific link

Member Avatar for aniseed
0
148
Member Avatar for hemanthjava

I am using FocusTraversalPolicy policy in my Swing Project for tab out functionality. In some screens some componenets(combo box , textbox etc) are disabled in between some enabled components. So when i tab out from those which are enabled it loses focus when i tab out as that component after …

0
66
Member Avatar for tripnip

I'm new at Java, and I'm probably just an idiot, but I need to know how to show an answer as both a fraction and a decimal. Can anyone tell me how?

Member Avatar for server_crash
0
157
Member Avatar for sam1

hi, I want to know what a thread is and what it is used for. also how it is used...:mrgreen: thanks

Member Avatar for Phaelax
0
134
Member Avatar for Julie444

I have the following problem with a servlet in production on the Internet. I am using POST in a servlet to send the data to the servlet. I see in the log from the servlet that in rare cases the post parameters received in the servlet are null, and when …

Member Avatar for monkeyMojo
0
175
Member Avatar for MAD_COW711

my antivirus is detecting a "download. trojan" virus, but it cannot be deleted, cleared, or quarantined. its pretty much making it so that i can't get on internet explorer- i'm amazed i was able to get on now... anyways, i ran htj---- here's the log.... hopefully somebody can help me? …

Member Avatar for MAD_COW711
0
640
Member Avatar for mohamad11

Hi plz if i have a text file file1.txt contains for example: Hi Bob ? How are You? I need to meet u. See u Bye and i need to copy this file contents to another file but without line separator i need to ignore it so i want for …

Member Avatar for aniseed
0
62
Member Avatar for mohamad11

:sad: Hi ,I have a text file and it contains a message ,I want to extract the last four characters in this file and then convert it to integer i did the following: FileInputStream Received_Message=new FileInputStream ("MyFile.txt"); BufferedReader buff2=new BufferedReader(new InputStreamReader(Received_Message)); System.out.println("Your Received message is as following:"); while((recv_Message=buff2.readLine() )!=null){ System.out.println(recv_Message); …

Member Avatar for aniseed
0
421
Member Avatar for xlhmx

is there any method to split this line into StringTokenizer or by regular express? [B]1009027,"PMP Exam Prep (4th Edition)","",8,0,0,5,4,"Paperback","0971164738","","",89,89,743,"01 October, 2002","Project management@@@Examinations, questions, etc@@@Study Aids@@@Professional@@@Architecture@@@Tests@@@Study Guides@@@Education@@@Business & Economics@@@","0971164738"[/B] i wanna split the word by the delimiter "," but i found that there is some "," inside the double quote....so is …

Member Avatar for Phaelax
0
122
Member Avatar for wanda

I wrote a simple program for tictactoe and have everything working except a method to check and see if a player has won the game diagonally. I am not sure how to write the for loop to check the board. Code: [INLINECODE] public class Board extends ReactiveDrawingPanel implements GameConstants { …

Member Avatar for iamthwee
0
158
Member Avatar for wanda

When using the modulus, if a<b, then a%b = a. But why, if a is negative, does -a%b = -a? According to the division algorithm, the remainder r must be >= 0 and <|b|.

0
93
Member Avatar for ilikerps

Hello, I am trying to write a simple updater program (in Java). A client would connect to the server, which would hand out any files it needs updated. One example would be updating a Java .class file. I have tried to just copy a class file, to see if that …

Member Avatar for ilikerps
0
161
Member Avatar for Dark_Omen

Hello, I was wondering if there was a way to find how many lines there are in a text file, and if so can you find out how many lines in the text file start with a particular word (an identifier). Thanks

Member Avatar for Phaelax
0
209
Member Avatar for sam1

hi, what is the difination name, when a method calls itself in its body? thanks

Member Avatar for sam1
0
224
Member Avatar for saunde

i'm making a project based on a UML, and i have a method that i don´t no how to do it, and what is to do. [CODE] public VertexIterator getEdgesIterator(){ // TO IMPLEMENT }[/CODE] here's the class WeightedEdge and Vertex : Classe Vertex [CODE]package SegundoTrabalhoTerceiraPartePrimeiraPergunta; import java.util.*; public class Vertex …

0
100
Member Avatar for shimul_bari

Hello, My problem is to connect through mobile to a servlet in web server and then collect some data . I hav built a servlet which serves this requests. I tworks fine in my pc. but after uploading it to web server it cannot connect to that server. Can anyone …

Member Avatar for aniseed
0
49
Member Avatar for muthumari

Hi, I have an error, during accessing a datbase using jsp:useBean from jsp.Urgent i need this one my source code ispackage SQLBean; DbBean.java import java.sql.*; import java.io.*; public class DbBean implements java.io.Serializable{ private String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver"; private Connection dbCon; public DbBean(){ super(); } public boolean connect() throws ClassNotFoundException,SQLException{ Class.forName(dbDriver); …

Member Avatar for aniseed
0
157
Member Avatar for lwinn213

Hi All! I've been working on a simple MVC style / struts web application which will allow a user to view a product database and have the option to update a record. The initial index.jsp page works and forwards to the right locations, the update page displays but is producing …

Member Avatar for masijade
0
313
Member Avatar for sam1

hi, can a server and client application communicate using strings. for example say server sends ok and error for each request received....... thanks

Member Avatar for Phaelax
0
125
Member Avatar for Psyqwix

I'm fairly new to java and need someone to point me in the right direction. I'm writing a non web-based java program, and part of that program requires the ability to download files from websites (e.g. images, zip etc). I tried looking through the java class descriptions on the sun …

Member Avatar for Psyqwix
0
129
Member Avatar for Knightofdurham

Hi my name is Knightofdurham but my friends call me Knight anyways i am a student in the Uk doing information systems and management. ANyways the reason I have registered to this website is because i need help with one of my java programs. Basically at the moment it sorts …

Member Avatar for Psyqwix
0
115
Member Avatar for psodhi

Hi Friends, i made a window with a Panel and painted a text on it. Now i want to set a background color for the panel but it does not reflect in the window.. i am posting the code here.. Please let me know if anything is wrong with the …

Member Avatar for psodhi
0
281
Member Avatar for nabil1983

Ok got a new problem i've started to implement a GUI for my program but for some reason in the actionlistener metho i cannot pass the method i want to display.. I dont know what im doing wrong because i am not familiar with using GUIs... can somebody please help …

Member Avatar for jwenting
0
150
Member Avatar for rac_engg

Does anyone know how to use JTAPI and JSAPI and how to configure thse two in the system also tell if we want to swith on our phone automatically from phone if any incoming come then what is the procedure does the motherboard have inbuild feature for this?

Member Avatar for rac_engg
0
75
Member Avatar for hsharma65
Member Avatar for forrest

what I use is SQL SERVER 2000,the system is WINXP SP-2 I set the classpath:C:\Borland\JBuilder2005\jdk1.4\lib;.;C:\Program Files\Tomcat 5.0\common\lib;.; I use the JDBC-ODBC to connect the database,the original code is package hospital.db; import java.sql.*; import hospital.db.*; public abstract class DBConnection { private static Connection conn = null; public static Connection getConnection() { …

Member Avatar for ponloges
0
298
Member Avatar for nabil1983

Ok i got this thing to compile now perfectly no errors, when i run it the menu comes up. The problem is when i use the option in the menu it gives me an exception error?? ne one know where i went wrong on this one.... what i did was …

Member Avatar for DeepZ
0
122
Member Avatar for nabil1983

Hello Everytime i compile this i keep getting an error on non-static method can not bu passed to static method, i understand that. But how can i get around this, without making the non-static method static , because it has variable relating to otha methods ... i also keep getting …

Member Avatar for DeepZ
0
225
Member Avatar for iamthwee

Ok, I've been looking through some of the older threads and noticed some bad things regarding vectors. So what's the deal. Are they worth using in java or should I avoid them like the plague? And if I should, what should I be using instead? The same questions applies to …

Member Avatar for aniseed
0
249
Member Avatar for ivanr
Member Avatar for aniseed
0
96
Member Avatar for Mishac

can any one help me with the code for the pop & push methods in the class that implement a Stack with two Queues

Member Avatar for aniseed
0
115
Member Avatar for Zxenobia0

I need help working on my Java project. Any amount is welcome. The project needs to prompt the user for a file input (txt), file output, and five words to search through the input file. Each input needs to be equipped with try and catch code to prevent crashing. The …

Member Avatar for Phaelax
0
150
Member Avatar for mperkins07

Can you help me wlth the following work?: This sample program shows how to print the current month, now using the "Calendar" object (instead of the Date object which has been deprecated, meaning it has been slated for removal from the language). [code]// Program prints the current month import java.util.Calendar; …

Member Avatar for Phaelax
0
152
Member Avatar for sunny82

Hi, I am getting 3 similar types of errors.its saying illegal start of expression in public void makedeposit<int deposit>,public void makewithdraw<int withdraw> and public void showbalance<int a, int balance>{} plz help. here is my code--- [code]public class bank { bank b; public class output{ public output outputobject=new output(); } public …

Member Avatar for sunny82
0
197
Member Avatar for nabil1983

hello. Im having problems trying to get my jframe gui to work correctly i got the window all done fine but when i tell it to display somethis in the code , it comes up with errors when compiled. Can someone please tell me where im going wrong .. apreciate …

Member Avatar for DeepZ
0
187
Member Avatar for K.Duncan

I'm working on a fairly basic program and can not seem to get it to work. I've checked my spelling and all that; the only thing I can think of is my main isn't able to find my class file. Here's the error message: ComplexDemo.java:10: cannot find symbol symbol : …

Member Avatar for DeepZ
0
168
Member Avatar for monisola
Member Avatar for Mishac
Member Avatar for monkeyphonics

Ok this is a homework program and this is my first JAVA course I am stuck on how to pass double values from one method to another I have a menu that appears with this code [code] public static int menu(int curmenuselection, double curitemprice) { while(curmenuselection != 5) { double …

Member Avatar for monkeyphonics
0
154
Member Avatar for mohamad11

hi to all... Plz i wnt a valuable code to append two text files in java i tried alot using WriteBuffered and FileOutputStream(file,true) but without any use i wrote the following code: import java.io.*; public class append{ public static void main(String[] args) throws IOException { FileInputStream Message_File=new FileInputStream ("C:/JBuilder4/lib/input6.txt"); BufferedReader …

Member Avatar for jwenting
0
856
Member Avatar for moon_light

i ve Q which ask me to write method called nodelevel(int k ) which returns how many nodes in level k.. and i write a code but i dont know what is wrong with it ??? [code]public nodelevel(int k){ if(root == null) return 0; else return getnodelevel(root, 1); } private …

Member Avatar for jwenting
0
203
Member Avatar for sam1

hi, which one of these two would be better to design a file transfer protocol FileInputStream or FileReader? i know FileInputStream is meant to be for image type of files........ thanks

Member Avatar for jwenting
0
247
Member Avatar for forrest

I get confused about these things,it will be better if you can illustrate these things with some code. thank you

Member Avatar for masijade
0
113
Member Avatar for gkakkireni

Hi to all i have requirment like this the field length is 15 digits but am getting input only 6 digits..means i have to put spaces after the 6 digits position menas spaces after the value.how to do it in java,could u send the sample programe because i dont know …

Member Avatar for vimal_parakhiya
0
85
Member Avatar for behrk2

Can someone please help me convert the following code to C? I am just learning C and this is too overwhelming... the java code basically reads in a file (specifically for this program, a text file or whatnot for assembly language code), and the program is a pretty printer which …

0
81

The End.