Click here to Skip to main content
16,006,348 members
Home / Discussions / Java
   

Java

 
AnswerRe: java coding Pin
427748030-Aug-09 23:48
427748030-Aug-09 23:48 
QuestionSVD of image using JAMA.. Pin
ankita0529-Aug-09 20:51
ankita0529-Aug-09 20:51 
AnswerRe: SVD of image using JAMA.. Pin
427748030-Aug-09 12:06
427748030-Aug-09 12:06 
GeneralRe: SVD of image using JAMA.. Pin
ankita0530-Aug-09 15:42
ankita0530-Aug-09 15:42 
QuestionRegarding jdk 1.6 features Pin
kirancgi29-Aug-09 20:23
kirancgi29-Aug-09 20:23 
AnswerRe: Regarding jdk 1.6 features Pin
427748030-Aug-09 12:09
427748030-Aug-09 12:09 
Questiongo through an HTML file and create a list of all the bold and italic words Pin
Sadaiyappan29-Aug-09 9:14
Sadaiyappan29-Aug-09 9:14 
AnswerRe: go through an HTML file and create a list of all the bold and italic words Pin
427748030-Aug-09 12:18
427748030-Aug-09 12:18 
import java.io.File;
import java.util.*;

public class RegularExpression 
{
	public static void main(String[] args) throws Exception 
	{
		Scanner scan = new Scanner(System.in);
		
		System.out.println("Enter HTML file Name:");
		
		File HtmlFile = new File(scan.next());
		
		Scanner scan2 = new Scanner(HtmlFile);
		
		int FirstIndex =0,LastIndex =0;
		
		ArrayList<String> Bold = new ArrayList<String>();
		
		ArrayList<String> Italics = new ArrayList<String>();
		
		while(scan2.hasNext())
		{
			String q = scan2.nextLine();

			for (int i =0; i <q.length(); i++)
			{
				if (i+3<=q.length())
				{
					if (q.substring(i, i+3).equalsIgnoreCase("<b>"))
					{
						FirstIndex = i+3;

						for (int j = FirstIndex; j <q.length(); j++)
						{
							if (j+4<=q.length())
							{
								if (q.substring(j, j+4).equalsIgnoreCase("</b>"))
								{
									LastIndex = j;
									Bold.add(q.substring(FirstIndex,LastIndex));
									break;
								}
							}
						}
					}
					else
						if (q.substring(i, i+3).equalsIgnoreCase("<i>"))
						{
							for (int j = FirstIndex; j <q.length(); j++)
							{
								if (j+4<=q.length())
								{
									if (q.substring(j, j+4).equalsIgnoreCase("</i>"))
									{
										LastIndex = j;
										Italics.add(q.substring(FirstIndex,LastIndex));
										break;
									}
								}
							}
						}
				}
			}
		}
		
		System.out.println("Bold:");
		
		for (int i =0; i <Bold.size(); i++)
		{
			System.out.println(Bold.get(i));
		}
		
		System.out.println("Italics:");
		
		for (int i =0; i <Bold.size(); i++)
		{
			System.out.println(Italics.get(i));
		}
	}
}

QuestionJava code of Vernam Cipher Algorithm Pin
Munna Bhagat28-Aug-09 6:50
Munna Bhagat28-Aug-09 6:50 
AnswerRe: Java code of Vernam Cipher Algorithm Pin
David Crow28-Aug-09 8:42
David Crow28-Aug-09 8:42 
AnswerRe: Java code of Vernam Cipher Algorithm Pin
427748030-Aug-09 12:22
427748030-Aug-09 12:22 
Questionmaking msn plugin using java [modified] Pin
Muhammad Adeel Zahid28-Aug-09 6:45
Muhammad Adeel Zahid28-Aug-09 6:45 
AnswerRe: making msn plugin using java Pin
42774802-Sep-09 7:21
42774802-Sep-09 7:21 
QuestionRe: making msn plugin using java Pin
Muhammad Adeel Zahid2-Sep-09 11:38
Muhammad Adeel Zahid2-Sep-09 11:38 
AnswerRe: making msn plugin using java Pin
42774802-Sep-09 17:51
42774802-Sep-09 17:51 
QuestionRe: making msn plugin using java [modified] Pin
Muhammad Adeel Zahid22-Oct-09 1:45
Muhammad Adeel Zahid22-Oct-09 1:45 
QuestionRe: making msn plugin using java [modified] Pin
Muhammad Adeel Zahid4-Nov-09 19:47
Muhammad Adeel Zahid4-Nov-09 19:47 
QuestionSlow performance of javax.swing.JOptionPane.showOptionDialog Pin
Pasan Eeriyagama26-Aug-09 15:22
Pasan Eeriyagama26-Aug-09 15:22 
AnswerRe: Slow performance of javax.swing.JOptionPane.showOptionDialog Pin
Nagy Vilmos26-Aug-09 22:03
professionalNagy Vilmos26-Aug-09 22:03 
GeneralRe: Slow performance of javax.swing.JOptionPane.showOptionDialog Pin
Pasan Eeriyagama27-Aug-09 1:36
Pasan Eeriyagama27-Aug-09 1:36 
GeneralRe: Slow performance of javax.swing.JOptionPane.showOptionDialog Pin
woo_378304-Jun-10 21:44
woo_378304-Jun-10 21:44 
GeneralRe: Slow performance of javax.swing.JOptionPane.showOptionDialog Pin
woo_378304-Jun-10 21:49
woo_378304-Jun-10 21:49 
GeneralRe: Slow performance of javax.swing.JOptionPane.showOptionDialog Pin
woo_378304-Jun-10 21:51
woo_378304-Jun-10 21:51 
QuestionHelp! on concatenation Pin
hellboy_8326-Aug-09 10:53
hellboy_8326-Aug-09 10:53 
AnswerRe: Help! on concatenation Pin
David Skelly27-Aug-09 4:23
David Skelly27-Aug-09 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.