Black Berry Hello World Program
I am learning Black berry programming. I have written a program "Hello World" using the eclipse plug in for Black Berry. Then I want to run the program using the Black Simulator from Run As --> Black Berry Simulator. A blank window is appeared. I tried to Load .cob file, still it is 开发者_如何学编程not working. Can any body please help me.
I think you didn't add the labelField
(With helloworld text) in MainScreen.
Otherwise, your labelfield
foreground color is the same as screen color.
Just try to override the pain() of the LabelField
.
eg:-
labelField= new LabelField("HelloWorld")
{
protected void paint(Graphics graphics)
{
graphics.setColor(Color.RED);
super.paint(graphics);
};
};
Try this; I think this should help you.
This is a very difficult question to answer correctly because there are many variables such as your OS, what exactly you mean by "blank window", the steps you may or may not have completed correctly in your tutorial.
If you are using a Windows machine, instead of trying to install the eclipse plugin yourself it might be easier for you to download and run the pre-installed eclipse bundle provided by RIM.
Next, I suggest you go back to the HelloWorld, tutorial, start from scratch. Double check each of your steps and take your time so you fully understand each of your steps. If you reach a part of the tutorial that you cannot complete then you should raise the exact part in this question.
But also! (And this is one of the most important things you must learn to become a successful programmer like me) Do not assume people have knowledge of your setup, your coding, or any variable when you ask a question. Put yourself in the shoes of the person answering it and consider what they would need to know in order to do so. This is such a fundamental thing that it should perhaps even be part of every HelloWorld tutorial.
精彩评论