32,199 Topics

Member Avatar for
Member Avatar for johnny70

I want to remove the first line in jtextpane and setting setContentType("text/html") at the same time. setContentType("text/html"); Element root = getDocument().getDefaultRootElement(); Element firstLine = root.getElement(0); getDocument().remove(firstLine.getStartOffset(), firstLine.getEndOffset()); When I use setContentType("text/html") in the code it does not remove the first line.

Member Avatar for JamesCherrill
0
763
Member Avatar for Kadian

int e=0; int Compatability=0; int numOfDisagreements=0; int tsize=likes.size()+dislikes.size(); int numOfCommonLikes=0; int numOfCommonDislikes=0; if (user.likes.get(e).equals(Stranger.likes.get(e))){ if ((Stranger.howDoYouLike(likes.get(e)))== 1 && user.howDoYouLike(likes.get(e))==1) { numOfCommonLikes=numOfCommonLikes+1; } } else if (user.dislikes.get(e).equals(Stranger.dislikes.get(e))){ if ((Stranger.howDoYouLike(dislikes.get(e)))== -1 && user.howDoYouLike(likes.get(e))==-1) { numOfCommonDislikes=numOfCommonDislikes+1; } else { numOfDisagreements=numOfDisagreements+1; } e++ ; } Compatability=(numOfCommonLikes+ numOfCommonDislikes)- numOfDisagreements; return Compatability; } Am getting a …

Member Avatar for JamesCherrill
0
162
Member Avatar for sesaso

what is correct solution in Inheritance ???? I am new to genetics in Java and I want to resolve this question I look at the question existing attachments please and what is the correct dissolved and thank you very much

Member Avatar for JamesCherrill
0
287
Member Avatar for Roger_2

this is my latest class assignment, i would really appreciate some assistence with my pseudo code to help me in the right direction. my code skeleton is provided at the end of this post. Deque A double-ended queue, often abbreviated deque and pronounced deck, is an object with the following …

Member Avatar for JamesCherrill
0
365
Member Avatar for Kujinn

Yo, I'm a first year Computer Science college student, I've been thinking of pursuing a career as a Game Programmer. I was wondering since the only languages we are learning at the moment are Java and SQL, how useful is Java for developing games. Should I self-teach other languages like …

Member Avatar for admiri92
0
195
Member Avatar for amogh.max

I have created the following button: <form method="post" action="website.sup"> <input type="submit" id="btn1" name="btn1"/> </form> I am trying to call a ".java" file when i press this button. Sample of my .java code : package website; import javax.swing.* public class sup implements Runnable{... How do i call my java file? Additional …

Member Avatar for stultuske
0
267
Member Avatar for SkateX

Greetings, I'm having problems with my output. Essentially I am just trying to print out any Cat who is over 3 years old and has Claws. But my output keeps printing out either nothing at all or the 3rd cat 3 times. I've struggled with this for hours trying to …

Member Avatar for JamesCherrill
0
297
Member Avatar for jjones0150

Hello Guys, I'm having trouble getting my code to run correctly. I need the program to ask the user do they want to continue after they guess the number correctly. If they say "y" the loop should restart if they reply "n" the program should end and close. I will …

Member Avatar for JamesCherrill
0
2K
Member Avatar for manalibhadula

Hi I am trying to connect to a server, to transfer a file. I have added remote to the known host file of source server and generated public key. From terminal i am able to login to remote server without password, but here through java , i am getting below …

Member Avatar for manalibhadula
0
294
Member Avatar for Trevor_5

trying to get the maximum location in my matrix of 4 columns and 3 rows. can anyone help point me in the right direction import java.util.*; public class Program3{ public static void main(String[] args){ double [][] m = createArray(); double [] colsum= new double [m[0].length]; for(int i=0;i<m[0].length;i++) colsum[i]= sum(m,i); printResult(m, …

Member Avatar for stultuske
0
202
Member Avatar for Amenda.St

I'm new with java programming so I'm sorry if my question is a lazy one. I'm working on a project that consists on collecting job offers from the web. So as a first step, I want to extract data (job offer data) from a specific webpage. So I want to …

Member Avatar for peter_budo
0
251
Member Avatar for jyotibborade

How do I edit jasper report at runtime? means i have to edit previously created jasper report properties like page height,width,show and hide some fields

Member Avatar for stultuske
0
47
Member Avatar for ema-miles

please some one help me send for me the codes for programme that helps in compueting the marks of stusednts by finding out their average total marks position in class and also tell if one is able to go to the next class with in a short time for a …

Member Avatar for stultuske
-3
129
Member Avatar for skill11

how i can write java programme like this out put Enter the number of minutes:*1000000000* 1000000000 minutes is approximately 1902 years and 214 days

Member Avatar for JamesCherrill
0
118
Member Avatar for murali2489

Hi All, I have an online screen in which a form filed is filled with Numeric Characters .. if the entered four digits are not numeric, it will throw an alert message saying "**Only numerics allowed**". Now the new requirement is it should accept alphanumeric characeters instead of Numeric Characters. …

Member Avatar for djjeavons
0
171
Member Avatar for Farhanalee

Modify the previous program to read in a list of floating-point values. The end of the input is indicated by the user entering a sentinel value -999. The program will display the following: the average of the values, the largest of the values, The smallest of the values, the range, …

Member Avatar for stultuske
0
137
Member Avatar for cngerra

I'm still a noob in JavaFX, I can print the content of the table that I query, the problem is that I want the content to be placed inside the tableview. This is the code that I have done. public class TableViewController implements Initializable{ @FXML private TableView<studentInfo> tblViewer = new …

Member Avatar for bharath_5
0
7K
Member Avatar for prem2

Dear all, I am using linux fedora os. But i cannot able to set the java Classpath command. Step 1: whereis java java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz Step 2: vi .bash_profile export JAVA_HOME=/usr/bin/java export PATH=$PATH:/usr/bin/java Step 3: java -version java version "1.6.0" OpenJDK Runtime Environment (build 1.6.0-b09) OpenJDK Server …

Member Avatar for sepp2k
0
2K
Member Avatar for Farhanalee

Write a program that reads a word and prints the number of syllables in the word. For this exercise, assume that the syllables are determined as follows: Each sequence of adjacent vowels a, e, i, o, u, y, except for the last e in a word, is a syllable. However, …

Member Avatar for iamthwee
0
299
Member Avatar for divinity02

hi guys I am practicing a java program and it goes like this. I am trying to this as a practice JAVA Object-Oriented program for a rental car company to create an inventory file(.txt) as a random access file which can easily be updated by users for the following specifications: …

Member Avatar for divinity02
0
176
Member Avatar for lena1990

hi all, i want to convert array of short to array of bytes in order to send it in Datagram Packet and then convert it from bytes to short

Member Avatar for JamesCherrill
0
336
Member Avatar for divinity02

hi guys havent been here for a while, but I have a question for you all. 1. how do you write a java object-oriented program 2. is it the same as a java program or different 3. does it have any similarities between both program

Member Avatar for divinity02
0
321
Member Avatar for Winston_1

I am having trouble writing the below java application. Here is what i am trying to accomplish Write a Java program that prompts a user to enter demographic information including year of birth (values 1900-2014), month of birth (values 1-12), day (value of 1-31) of birth, latitude and longitude of …

Member Avatar for rubberman
0
294
Member Avatar for ali11

GregorianCalendar cal = new GregorianCalendar(year, month, 1); nod = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); som = cal.get(GregorianCalendar.DAY_OF_WEEK); for (int i=1; i<=nod; i++){// plz explain this line int row = new Integer((i+som-2)/7); // plz explain this line. int column = (i+som-2)%7;// also this line. mtblCalendar.setValueAt(i, row, column);

Member Avatar for JamesCherrill
0
131
Member Avatar for iamthwee

So a lot of threads begin by some noob coming along and asking is c++ or c or java going to die and almost certainly, the answer, all have stood the test of time and this is simply panic nonsense spread by the spin doctors. http://www.infoworld.com/article/2613404/java/how-to-kill-java-dead--dead--dead.html But then it got …

Member Avatar for iamthwee
0
493
Member Avatar for Devesh_2

First Of all, I am trying to implement a video conferencing system using JMF. I want to access webcam of a remote computer to take images.I have successfully captured images from my local camera.But when i try to do this from "A" computer to access webcam of "B" computer , …

Member Avatar for iamthwee
0
718
Member Avatar for SkateX

Question: It seems my code won't work while looping. It's a simple password verifier, however entering subsequent passwords will return the same invalid as the previous password. The simple answer might be to set boolean values under the do so they reset everytime the loop runs. But if I do …

Member Avatar for SkateX
0
558
Member Avatar for Akrhoo

Hello Dear! Hope You All are doing Fine. i have querry. i am trying to make a program of Bank Account Details with classes and OBjects. i have put change name, change typ, dopist, withdraw options. now i want to see teh history. what name it was before the change, …

Member Avatar for stultuske
0
79
Member Avatar for Qaim
Member Avatar for Compton11

I'm currently reading about the JVM and how garbage collection works found here: http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html It discusses both the Mark and Sweep and the Generational garbage collection concepts. After reading through this tutorial, I'm confused on which garbage collection process the JVM actually uses. The whole time, I thought the JVM …

Member Avatar for mike_2000_17
0
217

The End.