Creating Your Own Form Controls in Java or any other Language?

koeks525

Executive Member
Joined
Jul 14, 2012
Messages
6,013
Reaction score
1,199
Location
Canada
Hi guys,

I been playing around with Java lately, and I will start playing with Android Programming. Java was not too bad for me - maybe this was the case because I had known a little bit of C#. I also had fun writing stuff that submits data from my Java application to a MySQL database server, on my web host :) :) I felt great! I love writing code in Java :)

How does one go about creating and using their own designed buttons, text boxes, drop down boxes, and other form controls when they are developing applications? I have not touched on this side just yet, I was using the provided form controls in Java and I was curious as to how developers get their own buttons and other form controls working in applications.

I am currently learning about Multithreading in Java, it doesn't seem so bad, but I will be practising this by building a DVD Store application for fun. I also want to learn of some cool design patterns (like MVC).
 
functionally there is no real difference between a class a control. A control usually has some methods etc., that are formatted and structured in such a way that a specific IDE can use it to perform reflection and therefore allow you to do the "drag and drop" stuff in the IDE. I hate controls, because they cause the class to become IDE specific and even OS specific. For Java, I would prefer to just create classes and put them in libraries. For C++ create a dll or lyb (depending on the OS)

When you drag a control in an IDE onto the work area, you simply implementing a class and setting some of its attributes in a single mouse action. First learn how to do this "by hand".

Before you even think about controls, master creating your own version of the basic classes, such as JButton etc., or whatever. In some cases, this is overkill, because the provided classes are usually good enough as a base class goes.
 
Controls on Android works differently from normal Java. Controls and screen layout in Android is more like a slightly simplified C# WPF. So, if your aim if for Android, then do not bother with Java controls.
 
Top
Sign up to the MyBroadband newsletter
X