View RSS Feed

All Blog Entries

  1. Apple Extensions

    by , 10-29-2014 at 03:46 AM
    Package com.apple.eat does not appear to be supported any more in jdk 8.
    I use com.apple.eawt.Application.setDockIconImage to set the application icon.
    Does anybody know of an alternative to this Method OR how to support this package in NetBeans 8+ running in Mac OS X Josemite
    Categories
    Uncategorized
  2. tcp client sometimes sends data to server properly and sometimes doesnt send any data

    by , 07-10-2014 at 10:07 AM
    Quote Originally Posted by maddy14 View Post
    Hey thanks a lot guys for your help.Now The program is working but there is an issue.Sometimes the clients sends data perfectly to the server whereas other times the client doesnt send any data to server.I dont know why is it happening .Please help me with this issue

    Client
    Java Code:
    public class Client {
    	public static void main(String args[]) throws IOException
    	{
    		int userinput =1;
    		while(userinput==1)
    		{
    			String serverName =
    ...
    Categories
    Uncategorized
  3. [HELP] java.lang.ArrayIndexOutOf BoundsException

    by , 10-18-2013 at 11:58 AM
    Quote Originally Posted by SurfMan View Post
    Quote Originally Posted by tonie View Post
    I thought it was something like that, but I don't understand because I have this in the text file and it has 8 strings and 1 int. But this is what I got in the text file.



    I'm sorry, but I don't know how to do SOP variable to check. I would appreciate if you could show me how.
    Java Code:
    while(input.hasNext()) {
        word = input.nextLine();
        System.out.println("The line is " + word);
        tokenArray = word.split(";");
    ...
    Categories
    Uncategorized
  4. Help centering the square inside

    by , 09-14-2013 at 01:40 AM
    Quote Originally Posted by Messi5454 View Post
    I emailed the instructor my code and he said the only thing i have to do is center my inner square .
    i attached picture
    Attachment 5522

    Java Code:
    import java.awt.*;
    
    import javax.swing.*;
    
    
    // begining of the Gepmetry class
    // geometry class uses JFrame to draw the window and 
    // geometric shapes  
    public class Hw2  extends JFrame {
    
    //Variables to use for drawing 3 shapes.
    ...
    Categories
    Uncategorized
  5. Sending SMS to mobile from java app.

    by , 08-08-2013 at 05:11 PM
    Hello !!
    I need to send SMS from my java application to mobile .I am stuck because i cannot get the API's some are outdated and some are not working (free).
    Kindly help me please !!!
    Categories
    Uncategorized
  6. Getting user input on how meany times to loop... dunno how

    by , 06-23-2013 at 01:04 AM
    I have ben trying to get this ... it wont let me change a string to a int. And i dont know of any other way please help
    I want the user to be able to put in a number and have the probram loop as meany times as the user puts in.. any ideas?
    here is the code i tryed
    Java Code:
    import java.util.Scanner;
    public class ae{
    	private static Scanner user_input;	
    	public static void main(string[] args){
    	System.out.println("How meany times to loop the code");
    ...
    Categories
    Uncategorized
  7. sorry for all the questions

    by , 06-14-2013 at 03:22 PM
    Quote Originally Posted by gbonecapone View Post
    thanks for the advice. and sorry my work through me into this big project that no one else here knows how to do, and told me to learn java and take thier old true basic code and translate it. since the program is the heart of the company i cant really release but info about it (meaning formulas and some functions) but its a program to output data based on 9 inputs to send to a mazak to cut a timing screw for bottle packaging lines. im just trying to figure out some simple functions in order to finish
    ...
    Categories
    Uncategorized
  8. Homework help - Dice Roll

    by , 04-28-2013 at 02:03 AM
    Quote Originally Posted by Slick Java View Post
    Hi, I am having trouble with this program. The point of this program is to roll a dice, store dice values in an array and print out how much time the value has been occurred. The output should be like this:

    1 3

    4 1

    5 1

    2 1

    But I am getting this:

    1 3

    4 1

    5 1

    1 3

    2 1

    1 3


    I am trying to find a way to get
    ...
    Categories
    Uncategorized
  9. Future Cheat Sheets

    by , 10-30-2012 at 09:38 PM
    Just trying to think of the topics that I want to create cheat sheets about. In the next few weeks I plan on making many more of these, here are a few topics that I think I will start with:
    • Linked Lists
    • Abstract Data Types
    • Abstract Algorithmic Analysis
    • AWT Event Handling
    • Swing Components
    • Swing Event Handling?
    • Inheritance
    • Polymorphism
    • Interfaces
    • Exception Handling



    This is in no particular order, and I will probably be hopping around this list ...
    Categories
    Uncategorized
  10. File Input Output Cheat Sheet

    by , 10-30-2012 at 05:18 AM
    File Input Output Cheat Sheet

    Importing Libraries
    The primary library that deals with files:
    Java Code:
    import java.io.File;
    The library that deals with writing to files:
    Java Code:
    import java.io.PrintWriter;

    FYI
    If there is more then one type of information that is being transferred to or from a file, it is usually best to use a record; IMO.


    Writing to a File

    Declare ...
  11. AWT Component Cheat Sheet

    by , 10-30-2012 at 03:15 AM
    AWT Components Cheat Sheet

    Importing Libraries
    There are two main libraries that involve the AWT tools. This package contains the core AWT graphics classes. Contains component classes for buttons, text fields, labels, frames, panels, dialogs, and scroll panes. It also contains the layout managers such as flow layout, border layout, and grid layout. Also included are the cusrom graphics classes such as graphics, color and font.
    Java Code:
    import java.awt.*;
    ...

    Updated 10-30-2012 at 07:02 AM by penguinCoder

    Categories
    Cheat Sheet
  12. ArrayList Cheat Sheet

    by , 10-29-2012 at 12:17 PM
    Importing the Library
    Before you can use an ArrayList, you must first import the necessary library.
    Java Code:
    import java.util.ArrayList
    Creating a Generic ArrayList
    Generic ArrayList is an ArrayList with a type; no other type is allowed to be inserted into the ArrayList.
    Java Code:
    ArrayList<type> listName = new ArrayList<type>();
    Example of this would be:
    Java Code:
    ArrayList<String> myArrayList = new ArrayList<String>();
    ...
  13. Virtual Memory Cheat Sheet

    by , 10-27-2012 at 05:39 AM
    Brief Description:
    'Virtual' Memory is the mental model, or abstraction, that the programming language provides to the programmer to explain how computer memory is managed while you program is running. It is NOT the same as physical memory.

    Run Time:
    At run time, the operating system handles the translation from 'virtual' memory addresses to physical memory addresses, and the programmer does no need to be aware of this process.

    Static Region:
    This ...

    Updated 10-30-2012 at 05:19 AM by penguinCoder

    Categories
    Cheat Sheet
  14. Records Cheat Sheet

    by , 10-27-2012 at 05:25 AM
    Brief Description:
    A record is pretty much just a programmer defined data type. It combines one or more pieces of information, or potentially different data types, into one unit. Structure wise, it is just a template that defines how to interpret the contents of a sequence of memory locations.

    First outside of any class, define the new data type:
    Java Code:
    class recordName{
      public [dataType] fieldName;
      ..repeat for any number of types..
    }
    ...
  15. Random Number Cheat Sheet

    by , 10-27-2012 at 05:00 AM
    Just for FYI, computers cannot generate actual random numbers. They are machines, and they do what they are told; and therefore cannot just choose a number at random. Mathematicians would call the process this process 'psuedo-random' number generation, but I didn't feel that made a good title so, whatever.. Just covering all the bases.

    First you will have to import the library:
    Java Code:
    import java.util.Random;
    Next, you create a random number generator; ...
  16. Scanner Class Cheat Sheet

    by , 10-18-2012 at 01:26 AM
    The Scanner class can be used for many things other then just getting input from the user; however this cheat sheet/tutorial is just going to be about getting input from the user.

    Defining the Scanner Class
    Java Code:
    import java.util.Scanner;
    
    public class ClassName{
      ...code...
    }
    It will tell the translator to look in that directory for the code defining the Scanner class.


    Declaring the Scanner
    If you ...

    Updated 10-18-2012 at 01:29 AM by penguinCoder

    Categories
    Cheat Sheet
  17. String Cheat Sheet

    by , 10-18-2012 at 01:05 AM
    A string is a piece of text, that is zero or more characters in length. In Java, strings are considered to be pre-built objects. The variable for a string does not store the value of the string, rather it is a reference point, or pointer, to the storage location of where the string is kept.


    Declaring a String:
    Java Code:
    String s1;
    Assigning a Value On Declaration:
    Java Code:
    String s1 = "Hello World!";
    Assigning ...

    Updated 10-18-2012 at 01:29 AM by penguinCoder

    Categories
    Cheat Sheet
  18. Class and Method Terminology Cheat Sheet

    by , 10-17-2012 at 11:45 PM
    Class Body - the area between the braces, that contains all the code.

    Constructors - used for initializing new objects

    Declarations - fields that provide the state of the class and its objects

    Methods - implement the behaviour of the class and its objects

    Fields - member variables in a class

    Local Variables - variables in a method or a block of code

    Parameters - is the list of variables in a method declaration ...

    Updated 10-18-2012 at 01:30 AM by penguinCoder

    Categories
    Cheat Sheet
  19. Class and Method Cheat Sheet

    by , 10-17-2012 at 11:42 PM
    Declaring a Class
    Java Code:
    class ClassName{
      ...code...
    }

    Declaring a Class with Parent
    Java Code:
    class ClassName extends parentClassName{
      ...code...
    }

    Declaring a class with Interface
    Java Code:
    class ClassName implements interface1, interface2, interface3{
       ...code...
    }

    Declaring a Class with Fields
    Java Code:
    class ClassName{
      public
    ...

    Updated 10-18-2012 at 01:30 AM by penguinCoder

    Categories
    Cheat Sheet
  20. Some Basic Technical Terminolgy Cheat Sheet

    by , 10-10-2012 at 05:08 AM
    Well I just got out of class, and I thought I would do a brain dump of some of the terminology that is utilized in Programming and Computer Science. This is going to be in more human readable format then most places I have found on the Internet.

    Abstract Algorithm Analysis
    What is O(N)?
    Big O of N, and it is commonly pronounced, is when the run-time of an algorithm is approximately proportional to the size of the data (N), when there are large amounts of data; in the ...

    Updated 10-18-2012 at 01:30 AM by penguinCoder

    Categories
    Cheat Sheet
  21. problem with shopping cart

    by , 08-29-2012 at 03:15 PM
    how do i increase the quatity of an item when it is added again and again into my shopping cart table.there is only a button add to cart.there is no textfeild for quantitiy.
    the code as of now i have retreives the items from database and add it into the shipping cart table. if i clik on it again and again the same item wil be shown again and again.
    Java Code:
     DefaultTableModel model = (DefaultTableModel) 
    tbl1.getModel();
                DefaultTableModel tm = (DefaultTableModel)
    ...
    Categories
    Uncategorized
  22. java (7) equivalent of .Net timespan

    by , 07-28-2012 at 08:03 AM
    Quote Originally Posted by .paul. View Post
    i used Dates in this particular case, as they were better suited to the application.

    but i also created a java TimeSpan class, similar to the .Net Framework TimeSpan class:

    Java Code:
    package javaTimeSpans;
    
    /**
     *
     * @author Paul
     */
    public class TimeSpan {
        
        private int _days;
        private int _hours;
        private int _minutes;
        private int _seconds;
        
        public int Days(){
    ...
    Categories
    Uncategorized
  23. xml encoding problem.

    by , 07-11-2012 at 11:52 AM
    Hi All,
    I am trying to embedd an xml response string as CData inside an XML tree. The main XML tree is not in my control to create or change. I just have a class object where i am just setting the content as String, where the string is my xml.

    The problem is when the mail xml tree appears, the content of my xml ( RawProfile ) are not properly encoded.

    Java Code:
    <ns5:PotsdamCache xmlns:ns2="http://schemas.xmlsoap.org/ws/2002/12/secext"
    ...
    Categories
    Uncategorized
  24. Architecture of Web Service

    by , 07-07-2012 at 08:43 PM
    Following diagram explains the architecture of the web servers.

    Name:  1.jpg
Views: 16924
Size:  29.1 KB

    Web Service Architecture


    Web Service Discovery: All the web services are discovered with the help of this part by meeting certain requirements and passing filters. The UDDI which stands for Universal Description, Discovery and Integration handles this part of web services.

    Web Service Description: All the web services are self describing which ...
    Categories
    Tutorial
  25. SOAP - Envelope Element

    by , 07-07-2012 at 08:40 PM
    The end and the start of the message are indicated by SOAP envelope. The receiver will be informed of the complete message arrival. When a message is received and processed, it will be informed by the SOAP envelope. So it solved the major problem of informing message processing. So in other words we can say that is a packaging method.

    Following points will explain it in more detail:

    • A root element is the base of SOAP envelop message and it is contained by all the
    ...
  26. SOAP Introduction

    by , 07-07-2012 at 08:39 PM
    To exchange messages and information between multiple computers, XML based protocol is used which is called SOAP. SOAP is XML based protocol so you can say that it is the XML specification application.

    Following rules or statements are considered as true for the SOAP.

    It is a protocol for communication.
    SOAP stands for Simple Object Access Protocol.
    It is designed to use internet for all its communication.
    It has the facility to use HTTP ...
    Categories
    Tutorial , SOAP
  27. Log4J Support Objects

    by , 07-07-2012 at 08:37 PM
    Following are the log4j framework important support objects which are critical in this framework.

    Level Object: This object is used to define priority of log information. Following log levels are defined in the log4j API:
    o INFO
    o DEBUG
    o ERROR
    o OFF
    o FATAL
    o WARN
    o ALL

    Filet Object: This object is used to filter and analyze the logging information. Based on the analysis and filter criteria, logging information is ...
    Categories
    Tutorial
  28. log4j - Core Objects

    by , 07-07-2012 at 08:36 PM
    Following are the log4j framework important core objects which are important and play a critical role in this framework.

    Logger Object: The Logger object is provided by the top Logger layer. All the information captured by this Logger Object is stored in a hierarchy and this is the main object responsible for collecting all information.

    Layout Object: The Layout Object is responsible for formatting all the information in multiple styles. The Layout Objects helps ...
    Categories
    Tutorial
  29. log4j Introduction

    by , 07-07-2012 at 08:34 PM
    Log4J is a Java based API that provides a logging framework which is:

    Fast
    Reliable
    Flexible

    The Apache software License provides the Log4J distribution. It has been also ported to following different languages:

    C++
    C
    C#
    Python
    Eiffel
    Ruby

    Following are the core features and functionalities of Log4J Framework:

    It is configurable at runtime using files. ...
    Categories
    Tutorial
  30. What are the Major Servlets Tasks

    by
    JSP
    , 07-07-2012 at 08:31 PM
    Following are the major servlets tasks:

    The Servlet major task is to read client data that is explicitly sent. It may include:
    o Data sent by a web page in form of HTML form
    o Data sent by an applet
    o Data sent by some HTTP client

    The Servlet major task is to read client data that is implicitly sent. It may include:
    o Media types
    o Cookies
    o Different compression

    The servlet is responsible for data processing ...
    Categories
    Tutorial
Page 1 of 48 12311 ... LastLast