Why do I need to catch this exception?

Hello all

This is a question about exception handling. I have to build a diary application that lets you save reminders on particular dates using xml. Just to make it a little tougher, I was not allowed to use the Calendar class. This is the code I wrote:

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.util.*;

import java.text.*;

import javax.xml.parsers.*;

import org.xml.sax.*;

import java.io.*;

import org.w3c.dom.*;

import javax.xml.transform.*;

import javax.xml.transform.dom.*;

import javax.xml.transform.stream.*;

importstatic java.lang.Math.*;

publicclass CalendarAssignmentextends JFrameimplements ActionListener

{

int MonthLength [] ={ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

public JButton [] days =new JButton[43];

private JLabel lbl, reminderlbl;

private JPanel top, grid, remindercenter, reminderbottom;

private JFrame reminderframe;

private JTextField year1, reminderinput, dayno;

private JComboBox months;

private Container container;

private JButton fetch, save, cancel;

private Document doc;

private File file;

private Node node;

private String year, month, day;

publicstaticvoid main( String[] args ){

CalendarAssignment c =new CalendarAssignment( );

c.setSize( 400, 300 );

c.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

c.show( );

}

public CalendarAssignment( ){

int CurrentYear, CurrentMonth;

String YearString, MonthString, Now;

Date today;

container = getContentPane( );

container.setLayout(new BorderLayout( ) );

SimpleDateFormat DateFormatter;

DateFormatter =new SimpleDateFormat("MM.yyyy" );

today =new Date( );

Now = DateFormatter.format( today );

MonthString = Now.substring( 0,2 );

YearString = Now.substring( 3,7 );

CurrentMonth = Integer.valueOf( MonthString );

CurrentYear = Integer.valueOf( YearString );

top =new JPanel( );

String [] items ={"January","February","March","April","May","June",

"July","August","September","October","November",

"December"};

months =new JComboBox( items );

months.setEditable(false );

months.setSelectedIndex( CurrentMonth - 1 );

year1 =new JTextField( );

year1.setText( YearString );

year1.setEditable(true );

year1.setHorizontalAlignment( year1.CENTER );

fetch =new JButton("Fetch Month" );

fetch.addActionListener(this );

top.setLayout(new GridLayout( 1, 3, 20, 0 ) );

top.add( months );

top.add( year1 );

top.add( fetch );

grid =new JPanel( );

grid.setLayout(new GridLayout( 7, 7, 0, 0 ) );

String [] week ={"Mon","Tue","Wed","Thur","Fri","Sat","Sun"};

for (int a = 0; a < 7; a ++ ){

JLabel lbl =new JLabel( week[a], JLabel.CENTER );

grid.add( lbl );

}

for (int i = 0; i < 42; i ++ ){

days[i] =new JButton( );

grid.add( days[i] );

days[i].addActionListener(this );

}

DrawCalendar( CurrentMonth, CurrentYear );

container.add( top, BorderLayout.NORTH );

container.add( grid, BorderLayout.CENTER );

}

privatevoid DrawCalendar(int SelectMonth,int SelectYear ){

int DisplayMonthLength, Buttons;

String ButtonID ="";

int OffSet = MonthStart( SelectMonth, SelectYear );

DisplayMonthLength = MonthLength [SelectMonth - 1];

if ( SelectMonth == 2 )

DisplayMonthLength += LeapYear( SelectYear );

for ( Buttons = 1; Buttons < 43; Buttons ++ ){

if ( ( Buttons <= OffSet ) || ( Buttons > ( DisplayMonthLength + OffSet ) ) ){

ButtonID ="";

days[Buttons-1].setEnabled(false );

}

else{

ButtonID = Integer.toString( Buttons - OffSet );

days[Buttons-1].setEnabled(true );

}

days[Buttons-1].setLabel( ButtonID );

grid.add( days[Buttons-1] );

}

}

privateint LeapYear(int year ){

int FourHundred, OneHundred, Fourth;

FourHundred = year % 400;

OneHundred = year % 100;

Fourth = year % 4;

if( ( ( FourHundred == 0 ) ) || ( ( OneHundred != 0 ) && ( Fourth == 0 ) ) )

return ( 1 );

else

return ( 0 );

}

privateint MonthStart(int Month,int Year ){

int OffSet, LastMonths, BeforeOrAfter, Years;

int AllDays = 0;

int YearDays = 365;

int YearMonths = 12;

BeforeOrAfter = Year - 2006;

Years = abs( BeforeOrAfter );

if( BeforeOrAfter != 0 )

BeforeOrAfter = BeforeOrAfter / Years;

switch( BeforeOrAfter ){

case 1:

for(int a = 2006; a < Year; a ++ ){

AllDays += YearDays + LeapYear( a );

}

AllDays += LastMonthsCalc( Month, Year );

break;

case -1:

for(int a = 2005; a > Year; a -- ){

AllDays += YearDays + LeapYear( a );

}

for( LastMonths = YearMonths; LastMonths >= Month; LastMonths -- ){

AllDays += MonthLength[LastMonths - 1];

if( LastMonths == 2 )

AllDays += LeapYear( Year );

}

break;

default:

if( Month > 1 )

AllDays += ( LastMonthsCalc( Month, Year ) );

}

OffSet = AllDays % 7;

if( BeforeOrAfter ==( -1 ) )

return( 6 - OffSet );

elseif( OffSet > 0 )

return( OffSet - 1 );

else

return( 6 );

}

privateint LastMonthsCalc(int Month,int Year ){

int Counter;

int days = 0;

for( Counter = 1; Counter < Month; Counter ++ ){

days += MonthLength[Counter - 1];

if( Counter == 2 )

days += LeapYear( Year );

}

return( days );

}

publicvoid CreateReminder( String buttonID, String yearID, String monthID ){

reminderframe =new JFrame( );

reminderlbl =new JLabel( );

reminderframe.setLayout(new GridLayout( 2, 1, 0, 0 ) );

remindercenter =new JPanel( );

reminderlbl =new JLabel("Please type in reminder to be saved for " + buttonID +" " + monthID +" " + yearID +":", JLabel.CENTER );

reminderinput =new JTextField( 30 );

reminderinput.setHorizontalAlignment( reminderinput.CENTER );

reminderinput.setEditable(true );

remindercenter.setLayout(new GridLayout( 2, 1, 0, 0 ) );

remindercenter.add( reminderlbl );

remindercenter.add( reminderinput );

reminderbottom =new JPanel( );

save =new JButton("Save" );

save.addActionListener(this );

cancel =new JButton("Cancel" );

cancel.addActionListener(this );

dayno =new JTextField( buttonID );

dayno.setEditable(false );

dayno.setEnabled(false );

dayno.show(false );

reminderbottom.setLayout(new FlowLayout( ) );

reminderbottom.add( save );

reminderbottom.add( cancel );

reminderbottom.add( dayno );

reminderframe.setSize( 500, 75 );

reminderframe.add( remindercenter );

reminderframe.add( reminderbottom );

reminderframe.pack( );

reminderframe.show( );

}

publicvoid SaveReminder( String dayID, String yearID, String monthID )throws Exception{

file =new File("Diary.xml" );

doc = DocumentBuilderFactory.newInstance( ).newDocumentBuilder( ).parse( file.toURL( ).toString( ) );

String year = yearID;

String month = monthID;

String day = dayID;

//System.out.println( year );

//System.out.println( month );

//System.out.println( day );

CreateEntry( doc.getDocumentElement( ) );

writeXmlFile( );

}

publicboolean CreateEntry( Node node ){

Node searchNode;

searchNode = getYear( node );

if( searchNode ==null ){

Element newNode = doc.createElement("Year" );

searchNode = node.appendChild( newNode );

newNode.setAttribute("Id", year );

}

node = searchNode;

searchNode = getMonth( node );

if( searchNode ==null ){

Element newNode = doc.createElement("Month" );

searchNode = node.appendChild( newNode );

newNode.setAttribute("Id", month );

}

node = searchNode;

searchNode = getDay( node );

if( searchNode ==null ){

Element newNode = doc.createElement("Day" );

searchNode = node.appendChild( newNode );

newNode.setAttribute("Id", day );

}

node = searchNode;

String entry = reminderinput.getText( );

Node textNode = doc.createTextNode( entry );

node.appendChild( textNode );

returntrue;

}

private Node getYear( Node node ){

node = node.getFirstChild( );

while( node !=null ){

if(node.getNodeName( ).equals("Year" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == year )

return node;

node = node.getNextSibling( );

}

returnnull;

}

private Node getMonth( Node node ){

node = node.getFirstChild( );

while( node !=null ){

if( node.getNodeName( ).equals("Month" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == month )

return node;

node = node.getNextSibling( );

}

returnnull;

}

private Node getDay( Node node ){

node = node.getFirstChild( );

while( node !=null ){

if( node.getNodeName( ).equals("Day" ) && String.valueOf( node.getAttributes( ).item( 0 ).getNodeValue( ) ) == day )

return node;

node = node.getNextSibling( );

}

returnnull;

}

privatevoid writeXmlFile( )throws Exception{

Source source =new DOMSource( doc );

Result result =new StreamResult( file );

Transformer xformer = TransformerFactory.newInstance( ).newTransformer( );

xformer.setOutputProperty( OutputKeys.INDENT,"yes" );

xformer.setOutputProperty( OutputKeys.DOCTYPE_SYSTEM,"Diary.dtd" );

xformer.transform( source, result );

}

publicvoid actionPerformed( ActionEvent e ){

String IDButton = e.getActionCommand( );

String IDYear = year1.getText( );

Object IDMonthObj = months.getSelectedItem( );

if( e.getSource( ) == fetch ){

String YearText = year1.getText( );

int YearNumber = Integer.valueOf( YearText );

int MonthsIndex = months.getSelectedIndex( ) + 1;

DrawCalendar( MonthsIndex, YearNumber );

}

elseif( e.getSource( ) == cancel ){

reminderframe.hide( );

}

elseif( e.getSource( ) == save ){

String IDDay = dayno.getText( );

String IDMonth = String.valueOf( IDMonthObj );

SaveReminder( IDDay, IDYear, IDMonth );

}

else{

String IDMonth = String.valueOf( IDMonthObj );

Toolkit.getDefaultToolkit( ).beep( );

int n = JOptionPane.showConfirmDialog( null,"Set reminder on this date?","Question", JOptionPane.YES_NO_OPTION );

if( n == JOptionPane.YES_OPTION ){

CreateReminder( IDButton, IDYear, IDMonth );

}

}

}

}

If you compile it, you will realise that I get an error about exception handling. My lecturer gave me an example code of how to do the same thing without using a GUI:

import javax.xml.parsers.*;

import org.xml.sax.*;

import java.io.*;

import java.util.*;

import org.w3c.dom.*;

import javax.xml.transform.*;

import javax.xml.transform.dom.*;

import javax.xml.transform.stream.*;

publicclass CallDOM

{

Document doc;

File file;

Scanner input;

int year, month, day;

String currentYear, currentMonth;

publicstaticvoid main(String args[])throws Exception

{

CallDOM cd=new CallDOM();

}

CallDOM()throws Exception

{

file=new File("Diary.xml");

//create DOM from file

doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file.toURL().toString());

input=new Scanner(System.in);

System.out.println("1) Create entry");

System.out.println("2) Read entry");

System.out.println("3) Show Diary");

System.out.println("4) Quit");

int choice=input.nextInt();

while(choice!=4)

{

switch(choice)

{

case 1: GetDate();CreateEntry(doc.getDocumentElement());break;

case 2: GetDate();ReadEntry(doc.getDocumentElement());break;

case 3: ShowDiary(doc.getDocumentElement());

}

System.out.println("1) Create entry");

System.out.println("2) Read entry");

System.out.println("3) Show Diary");

System.out.println("4) Quit");

choice=input.nextInt();

}

writeXmlFile();

}

publicvoid GetDate()

{

System.out.println("Enter date (dd mm yyyy)");

day=input.nextInt();

month=input.nextInt();

year=input.nextInt();

}

publicboolean ReadEntry(Node node)

{

node = getYear(node);

if(node==null)returnfalse;

node = getMonth(node);

if(node==null)returnfalse;

node = getDay(node);

if(node==null)returnfalse;

node = node.getFirstChild();

while(node!=null)

{

System.out.println(node.getNodeValue().trim());

node=node.getNextSibling();

}

returntrue;

}

publicboolean CreateEntry(Node node)

{

Node searchNode;

searchNode = getYear(node);

if(searchNode==null)

{

Element newNode = doc.createElement("Year");

searchNode = node.appendChild(newNode);

newNode.setAttribute("Id",Integer.toString(year));

}

node = searchNode;

searchNode = getMonth(node);

if(searchNode==null)

{

Element newNode = doc.createElement("Month");

searchNode = node.appendChild(newNode);

newNode.setAttribute("Id",Integer.toString(month));

}

node = searchNode;

searchNode = getDay(node);

if(searchNode==null)

{

Element newNode = doc.createElement("Day");

searchNode = node.appendChild(newNode);

newNode.setAttribute("Id",Integer.toString(day));

}

node = searchNode;

System.out.println("Enter Text");

String entry=input.next();

entry+=input.nextLine();

Node textNode = doc.createTextNode(entry);

node.appendChild(textNode);

returntrue;

}

publicvoid ShowDiary(Node node)

{

Stack<Node> stack=new Stack<Node>();

Node child;

stack.push(node);

while(!stack.empty())

{

node = stack.pop();

if(ProcessNode(node))

{

child = node.getLastChild();

while(child!=null)

{

stack.push(child);

child = child.getPreviousSibling();

}

}

}

}

privateboolean ProcessNode(Node node)

{

if(node.getNodeName().equals("Year"))

currentYear=node.getAttributes().item(0).getNodeValue();

if(node.getNodeName().equals("Month"))

currentMonth=node.getAttributes().item(0).getNodeValue();

if(node.getNodeName().equals("Day"))

{

System.out.print(node.getAttributes().item(0).getNodeValue()+"/"+

currentMonth+"/"+currentYear+": ");

node=node.getFirstChild();

while(node!=null)

{

System.out.println(node.getNodeValue().trim());

node=node.getNextSibling();

}

returnfalse;

}

returntrue;

}

private Node getYear(Node node)

{

node=node.getFirstChild();

while(node!=null)

{

if(node.getNodeName().equals("Year")

&& Integer.valueOf(node.getAttributes().item(0).getNodeValue())==year)

return node;

node = node.getNextSibling();

}

returnnull;

}

private Node getMonth(Node node)

{

node=node.getFirstChild();

while(node!=null)

{

if(node.getNodeName().equals("Month")

&& Integer.valueOf(node.getAttributes().item(0).getNodeValue())==month)

return node;

node = node.getNextSibling();

}

returnnull;

}

private Node getDay(Node node)

{

node=node.getFirstChild();

while(node!=null)

{

if(node.getNodeName().equals("Day")

&& Integer.valueOf(node.getAttributes().item(0).getNodeValue())==day)

return node;

node = node.getNextSibling();

}

returnnull;

}

privatevoid writeXmlFile()throws Exception

{

Source source =new DOMSource(doc);

Result result =new StreamResult(file);

Transformer xformer = TransformerFactory.newInstance().newTransformer();

xformer.setOutputProperty(OutputKeys.INDENT,"yes");

xformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"Diary.dtd");

xformer.transform(source, result);

}

}

My question is, why does the exceptions in the example code not need to be caught? And why do I have to catch the exceptions in my code? Several exceptions are thrown in the example code, but there is no catch statement.

Thanks for any advice!!

[32152 byte] By [Redstaara] at [2007-11-27 6:10:41]
# 1
You've got to be kigging me! nobody's going to sit and plough through that amount of code looking for a bug, especially not on a Friday!Narrow it down to what's actually wrong
georgemca at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 2
Why aren't you posting the error message?Kaj
kajbja at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 3

> Why aren't you posting the error message?

>

> Kaj

Could be a sneaky open-ended, broadcast interview question. Your answers and contact details will be captured by BigCorp. Inc. for future reference in case they wish to approach you, or you apply. It could be that

Hey! BigCorp! We don't need no stinkin' jobs!

georgemca at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 4
> Hey! BigCorp! We don't need no stinkin' jobs!I am my own boss. that's good enough :)
kajbja at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 5

Since your question didn't come with any relevant details, and since you have huge steaming piles of irrelevant code, all I can give is a general answer to "Why do I need to catch this exception?"

[url http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html]Exception tutorial at http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html[/url]

Here's a quick overview of exceptions:

The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.

RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.

If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.

Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

jverda at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 6
What a knob!
Hippolytea at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 7
> What a knob!?
jverda at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 8

I'm sorry about the length, but I was unsure as to where the problem lies. The error I get is:

CalendarAssignment.java:465: unreported exception java.lang.exception; must be caught or declared to be thrown

By the way, I am a 2nd yr computing degree student, not a big corp!!!!!

I have only been programming in java for about 3 months, so I suppose I aint done too bad to get this far.

Thanks again guys.

Redstaara at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 9

Basically, whatever part of your code that lies at line 465 throws an Exception of some sort, and it must be caught. Surround the relevant part with a try...catch block.

Better yet, tell us what line 465 is, and we can explain why the Exception is being thrown.

Message was edited by:

Djaunl

Djaunla at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 10
Yeah, but the exception somes up as unreported. I can't catch it if I dont know what the exception is.line 465 is: SaveReminder( IDDay, IDYear, IDMonth ); Within the action event method.Cheers for the help!
Redstaara at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 11
> > What a knob!> > ?The OP, for posting 700 lines just to demonstrate the need to catch one exception.
Hippolytea at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 12

> Yeah, but the exception somes up as unreported. I

> can't catch it if I dont know what the exception is.

"Unreported" means that you didn't declare your method to throw that excpetion. As I explained above, and as the tutorial explains, you have to either catch the exception, or declare that you throw it (so that your caller will know he'll have to deal with it.

The error message tells you exactly which exception you have to deal with.

Go through the tutorial and/or my explanation carefully and thoroughly.

jverda at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 13
> > > What a knob!> > > > ?> > The OP, for posting 700 lines just to demonstrate the> need to catch one exception.Ah.
jverda at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 14
Well I am sorry, but this is my first ever thread asking for help. I'm sure that when I become perfect (like you) I wont make mistakes on the forums again.Thanks for the help mate (idiot)
Redstaara at 2007-7-12 17:16:22 > top of Java-index,Java Essentials,Java Programming...
# 15

> Yeah, but the exception somes up as unreported. I

> can't catch it if I dont know what the exception is.

>

> line 465 is:

> SaveReminder( IDDay, IDYear, IDMonth );

>

>

> Within the action event method.

>

> Cheers for the help!

try {

SaveReminder(IDDay, IDYear, IDMonth)

} catch (Exception e) {

throw new java.lang.RuntimeException(e);

}

There... solved >;).

kevjavaa at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 16

> Well I am sorry, but this is my first ever thread

> asking for help.

It has nothing to do with Java or this forum. It's basic communcation.

I would think that it would be common sense that you don't need to post the entire universe, and that you do need to provide details about exactly what is going wrong and where.

Do you go to the doctor and tell him your life story, and then say, simply, "I'm in pain, so please fix it?" That's what you've done here.

jverda at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 17

> Well I am sorry, but this is my first ever thread

> asking for help. I'm sure that when I become perfect

> (like you) I wont make mistakes on the forums again.

>

> Thanks for the help mate (idiot)

Woops. Pretty much the anticipated response. Look, not to be rude, but just gracefully accept you've violated forum etiquette and everyone will just move on and you'll actually get some help. Don't be like those other guys that come and go, and don't get anywhere. Don't get into a flamewar over nothing

georgemca at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 18

> > Yeah, but the exception somes up as unreported. I

> > can't catch it if I dont know what the exception

> is.

> >

> > line 465 is:

> > SaveReminder( IDDay, IDYear, IDMonth );

> >

> >

> > Within the action event method.

> >

> > Cheers for the help!

> > try {

>SaveReminder(IDDay, IDYear, IDMonth)

> catch (Exception e) {

>throw new java.lang.RuntimeException(e);

>

>

> There... solved >;).

try {

SaveReminder(IDDay, IDYear, IDMonth)

} catch (Exception e) {

Thread.currentThread.stop(new Throwable("pah!");

}

georgemca at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 19
This is his first thread, and he doesn't seem like the basic forum idiot. Cut him some slack. Not everyone comes into this forum knowing exactly how to communicate his or her problem. Some people are just new to the language and the forum, and aren't exactly sure what is needed.
Djaunla at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 20
Never noticed that Thread.stop(Throwable) method before. I like it.
Hippolytea at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 21

> Yeah, but the exception somes up as unreported. I

> can't catch it if I dont know what the exception is.

>

> line 465 is:

> SaveReminder( IDDay, IDYear, IDMonth );

>

>

> Within the action event method.

>

> Cheers for the help!

The biggest tipoff that you haven't caught the Exception is the actual error message that you posted:

CalendarAssignment.java:465: unreported exception java.lang.exception; must be caught or declared to be thrown

Basically, follow the advice in replies #15 and #18, and check out the tutorial someone linked to.

Djaunla at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 22

> This is his first thread, and he doesn't seem

> like the basic forum idiot. Cut him some slack. Not

> everyone comes into this forum knowing exactly how to

> communicate his or her problem. Some people are just

> new to the language and the forum, and aren't exactly

> sure what is needed.

Agreed. It's just aggravating when the insults start flying about. No biggie, though

georgemca at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 23
> Never noticed that Thread.stop(Throwable) method> before. I like it.Been deprecated for yonks, mind you
georgemca at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 24

> This is his first thread, and he doesn't seem

> like the basic forum idiot. Cut him some slack. Not

> everyone comes into this forum knowing exactly how to

> communicate his or her problem. Some people are just

> new to the language and the forum, and aren't exactly

> sure what is needed.

Yep, and he used codez tags too which is rare for a firsts posts. He did however miss of some pretty important info which clearly explained the error.

_helloWorld_a at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 25
> Been deprecated for yonks, mind youHow long, exactly, is a yonk? ;)
kevjavaa at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 26

> Yep, and he used codez tags too which is rare for a

> firsts posts. He did however miss of some pretty

> important info which clearly explained the error.

My first few questions before I got used to this forum were so odd and randomly formatted/explained that TuringPest called me "crazy bananas". I'd say this guy is a notch up ;-).

Djaunla at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 27
> > Never noticed that Thread.stop(Throwable) method> > before. I like it.> > Been deprecated for yonks, mind youYonks, I haven't heard that word for yonks either.
_helloWorld_a at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 28
> > Been deprecated for yonks, mind you> > How long, exactly, is a yonk? ;)A yonk is roughly equivalent to a release of the JDK :)
georgemca at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 29

> Well I am sorry, but this is my first ever thread

> asking for help. I'm sure that when I become perfect

> (like you) I wont make mistakes on the forums again.

>

> Thanks for the help mate (idiot)

You caught us on a bad day :)... everybody's on a hair-trigger from the [url=http://forum.java.sun.com/thread.jspa?threadID=5179021]encrapsulation[/url] thread :).

kevjavaa at 2007-7-21 21:44:31 > top of Java-index,Java Essentials,Java Programming...
# 30

> > Yep, and he used codez tags too which is rare for

> a

> > firsts posts. He did however miss of some pretty

> > important info which clearly explained the error.

>

> My first few questions before I got used to this

> forum were so odd and randomly formatted/explained

> that TuringPest called me "crazy bananas". I'd say

> this guy is a notch up ;-).

Who are you calling a notch-up? You're the notch-up pal. Your momma's a notch-up

etc

georgemca at 2007-7-21 21:44:36 > top of Java-index,Java Essentials,Java Programming...
# 31

> Who are you calling a notch-up? You're the notch-up

> pal. Your momma's a notch-up

>

> etc

Don't y'all be talking 'bout my mama, girlfriend!

Anyway, TuringPest actually called me "cuckoo bananas". Oops.

Here's that thread if anyone wants a pretty funny read from my noobie days: http://forum.java.sun.com/thread.jspa?forumID=31&threadID=760485

Djaunla at 2007-7-21 21:44:36 > top of Java-index,Java Essentials,Java Programming...
# 32

Thanks alot for all your help guys.

Ok, I snapped back when I felt a bit offended. And for that I do apologise. Like I said before, I have only been programming in java for 3 months, and I believe I have done really well to get even this far. I just dont think I deserve to be ridiculed over the way I posted my question. Yeah, it was a bit noobish, but I AM a noob!!!

There is always someone who wants to pull you down rather than give advice. Maybe if they dont want to help noobs then they shouldn't even post a reply. That is what this forum is for, right?

Anyway thanks again to everyone who has given a suggestion. I really, really appreciate it and I will take more care when posting next time.

Cheers all.

Redstaara at 2007-7-21 21:44:36 > top of Java-index,Java Essentials,Java Programming...