Archive for the 'java' Category
I have some code that works correct when run from Eclipse, but throws FileNotFoundException when run from jar. Even more this code properly worked before but stopped after… I don’t know. May be after some Windows update? Here is the code 1: String path = Thread.currentThread().getContextClassLoader().getResource("stopwords.txt").getPath(); 2: System.out.println(path); 3: BufferedReader input = new BufferedReader(new [...]
October 22nd, 2011 | Posted in java | No Comments
Today i downloaded from sourceforge some java library and occasionally looked on statistics. The first place with 20% from all downloads takes … China. USA on the second place. India – 3. Spain – 4. And so on.
July 15th, 2011 | Posted in java, web statistics | No Comments
I have [custom] component that change its width but not height on resize. Cause is probably a bug in SWT Designer. This code was auto generated and produce a problem GroupLayout gl_shell = new GroupLayout(shell); gl_shell.setHorizontalGroup( gl_shell.createParallelGroup(GroupLayout.LEADING) .add(composite, GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE) ); gl_shell.setVerticalGroup( gl_shell.createParallelGroup(GroupLayout.LEADING) .add(composite)//problem here ); that looks like: changing code to : [...]
June 3rd, 2011 | Posted in java, swt | No Comments
So, what about writing bots in Java? Question only looks hard but have very simple answer: Use: HtmlUnit; Selenium; Using HtmlUnit to writing bots pretty good described. What is Selenium? Selenium is testing framework that consist of Firefox plugin that can record user’s actions in browser and Java (several another languages as well) [...]
May 27th, 2011 | Posted in java | No Comments
I looked for some project hosting site to store my projects. So, I made small research and find several sources already containing such collections. Besides of this I googled for “project hosting” and founded sites also added to result list: Assembla Asynchrony BerliOS bitbacket.org Bounty Source code.google.com codeplex.com/ CodeSpaces freepository GBorg GForge 2 github.com gna.org/ [...]
October 31st, 2010 | Posted in cloud, java, sites | No Comments
There are many Twitter follow-unfollow applications available. Some of them simply the bots that parse and interact with Twitter pages but some used Twitter API. Long time Twitter was very soft with his follow unfollow automation policy and only last days his politic was changed. Follow-Unfollow automation fully prohibited. Accounts that used some third party [...]
August 14th, 2010 | Posted in java | No Comments
In nowadays web oriented world users expectations are that desktop application behave like web application. And part of this that cursor must be changed when moving over button and checkbox controls. Next code snippet satisfied needs:
June 12th, 2010 | Posted in swing | No Comments
Suppose, we need link (hyperlink) in our desktop swing application, and clicking it should open specified page in default browser. Try this code:
June 11th, 2010 | Posted in swing | No Comments
Suppose, we need underlined label in our swing application. java.awt.Font doesn’t have this option. But next code solves the problem: JLabel clickItLabel = new JLabel(“<html><u>Click It</u></html>”)
June 11th, 2010 | Posted in swing | No Comments
Netbeans is great software. But sometimes very confusing. Netbeans have great java swing GUI editor with drag and drop palette. Use it. It is very helpful. Netbeans have also Java Desktop Application option: File -> New Project -> Java -> Java Desktop Application – don’t use it. It seems to be helpful but creates more [...]
June 11th, 2010 | Posted in java, netbeans, swing | No Comments
I want text on my JLabel object displayed in two lines. Next code does do the work: label.setText(” <html> first line <br> second line </html>”);
June 7th, 2010 | Posted in swing | No Comments
Suppose we have JPanel with name panel and JButton with name button on it. Try this code:
June 6th, 2010 | Posted in swing | No Comments
I used to use netbeans for php development. Sometimes it more simple to enter new files directly to project folder without using IDE. But these files is not viewable in IDE. There is a lack of refresh button for netbeans php project menu. Workaround is very simple: right click on -> Properties -> Ok. This [...]
April 24th, 2010 | Posted in netbeans, php | No Comments
Below is Google Software Engineer job description. Morality in the narrow sense: you can’t be GOOGLE software engineer without knowledge of Java. Morality in the broad sense: you can’t be GOOD software engineer without knowledge of Java.
January 12th, 2010 | Posted in java | No Comments
Java os.name property values Below are list of all Java os.name property values in alphabetical order. AIX Digital Unix FreeBSD HP UX Irix Linux Mac OS Mac OS X MPE/iX Netware 4.11 OS/2 Solaris Windows 2000 Windows 95 Windows 98 Windows NT Windows Vista Windows XP
December 14th, 2009 | Posted in java | No Comments
I get build errors in netbeans editor and project view now, although when I Clean Build the project I get Build successful in the output log. Whose fault is it? I don’t know. What to do? Open <your project> properties –> Sources and ensure that source format is the same as jdk you use. Press [...]
December 6th, 2009 | Posted in java, maven, netbeans | No Comments
Maven says: “The plugin does not exist or no valid version could be found”, but plugin present in your local repository. Whose fault is it? I don’t know. What to do? Try to delete plugin from local repository in order to enforce Maven to download it again.
December 6th, 2009 | Posted in java, maven | No Comments
1. Java Core or Java Basics (syntax, collections, threads, i/o etc.). 2. HTTP basics. 3. HTML, CSS and JavaScript basics. 4. JSP and Servlets. 5. Spring MVC, Spring IoC and Hibernate. 6. Persistence code generation and Domain Driven Frameworks.
September 19th, 2009 | Posted in java | No Comments
Java DAO generators review I need DAO generator (tool for persistence code generation). For what? I have third party application with database backend and I want to write my own application for insert/browse data to/in database. So i need framework that can create whole application or possible only DAO level from database schema. I prefer [...]
September 16th, 2009 | Posted in java | 1 Comment
August 6th, 2009 | Posted in java | 2 Comments