
Sun Certified Java Developer (SCJD)
JavaRanch Big Moose Saloon:Discussion Board
Problems:
Solutions:
References:
1.The Really Big Index
A list of all content pages in the The JavaTM Tutorial
***JTable***
In SCDJ assignment, explicitly mentions that the search result data must be rendered into JTable which is part of Swing Component.
And because of flexible design of swing component, in other words, it provides various ways of table implementation. so that Designer has to be considering which way would meet a requirement the most.
Problems that I have had.
1. getColumnClass() method throws an nullpointerexception on my table model class.
--> tablemodel getcolumnclass() method produces null pointer exception
***JFrame***
1.I wanted JFrame to get repainted by invoking repaint() on it, but JPanel object with it hasn't been repainted..
---> to understand a fundamental of paint mechanism Painting in AWT and Swing
After I had read some discussion on forum.sun.com, I knew how I achieve.
---> the search result with my search criteria.
the following is the source code snippet.
use JFrame.validate().
***int array intersection algorithm***
public class BaseWindow extends JFrame{
private JPanel mainPanel;
public Basewindow(){
initComponents();
}
private void initComponents(){
// set up components and add into JFrame.
}
public void setMainPanel(JPanel jPanel) {
System.out.println("BaseWindow.setMainPanel()");
if (mainPanel instanceof SearchResultScreen) {
System.out.println("this is SearchResultScreen");
}
if (mainPanel instanceof InitialScreen) {
System.out.println("this is InitialScreen");
}
this.remove(this.mainPanel);
this.mainPanel = jPanel;
this.add(this.mainPanel);
this.validate();
}
***JTextField***oh, It got stacked by formatting a pair of a label and corresponding text field.
Here what I wanted to do was to place a pretty ordinary pair on JPanel that
was "search:" label and corresponding search text field that a user can enter a
criteria in it.
The problem was come from misunderstanding of JTextField.setColumn() specification.
I thought it didn't affect textfield width, and I defined it by giving 200 as column size.
and I also defined both width as the following.
laName.setPreferredSize(new Dimension(100,25));
tfName.setPreferredSize(new Dimension(400,25));
My screen always came up in unwanted/unexpected layout because I exptected those width defined
by a setPreferredSize argument.But it's not..
Then I searched similar problem and even debugged my code for hours and
finally knew that unexpected layout was because of misuse of setColumn().
so after I deleted setColumn() code and only use setPreferredSize()
my layout is looking fine and that exactly what I wanted it to look.
***I/O Handling***
Hove to choose an appropriate way of handling I/O DB file in an assignment.
and for understanding the fandamental I/O in Java,
do read this tutorial first.
Lesson: Basic I/O
Top Ten New Things You Can Do with NIO
Conventional & Interruptable IO - Reading large files -- use FileChannel or BufferedReader?
***Handling a binary file in Java***
Hexadecimal - Wikipedia, the free encyclopedia
I have to parse a binary data file and store in memory and search with given criteria in it.
and must take place in fastest search!
so I am wandering what kinds of parsing a binary data file could be fastest?!
I need to learn some basics about data manuiplation in Java.. do read some discussion board and consider..
Java Programming - Parsing binary file- unsigned longs
***Flexible Search Mechanism***The Exam clearly mentions that the application search must be applied of flexible search
mechanism, but don't even say what is flexible and not.
So I tried and looked at some discussion on this ambiguous description of a specification.
Here you can see other's opinions on it here.
After I have read above discussion, I knew "flexible search mechanism" implies on a feature for application user,
then doesn't mean that flexible search algorism in terms of programming ways...
The key points that I have to accomplish are application search has to be flexible and fast.
To know how search could be faster in Java, you can check out this apache project and
some other discussion boards on forum.sun.com.
Apache Lucene
Java Programming [Archive] - Any Ideas For a Fast Search Engine?
Data structure for fast search within large text
Collections: Lists, Sets, and Maps - fast searching
I knew some keywards of search methods by reading disucussions.
Fastest is by hash O(1),
then comes binary search O(log N),
and finally linear search O(N).
@Op. Google on Boyer-Moore string search. It's a very fast search algorithm.
String_searching_algorithm
Lesson: Implementations
I needed to intersect 2 int arrays faster.
and to know what others do I searched and found some discussion on this topic.
Java Programming [Archive] - int array intersection algorithm
intersect in wiki
***Collections and Generics***
To learn new features of Java6.0, better watch some technical session for instance as the following.
JavaOne Online Technical Sessions
Java Technology Generics and Collections: Tools for Productivity TS-2890

1 comment:
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Servidor, I hope you enjoy. The address is http://servidor-brasil.blogspot.com. A hug.
Post a Comment