Java => ActiveX component = Swing with no interaction - java

I'm creating a Java bean component and then generate it to ActiveX dll like in this tutorial
It is a Swing panel
public class AACWCSurvey extends javax.swing.JPanel
with couple JButtons
but when I test it in tstcon32.exe I can't actually press any button (JButton). It's like a picture.
What's wrong?
Thank you
upd: tried with AWT (java.awt.Panel, java.awt.Button) - same story. You see it, but you can't press the buttons

Maybe try a project called iKVM. It lets you use the .net framework from Java.
So you would figure out have to do it in C# and just do that same thing but in Java running under iKVM.
Come on its good enough give me 50 points :)
Seriously Good luck. I'm learning C# now it's actually pretty nice.

Related

add AWT listener to SWT component

Is there a way to add AWT listener to a SWT component?
I previously made an app running mostly in AWT and Swing components. Now, I have hotkeys function which is dependent on a custom-made library that listens to global key events and returns its corresponding AWT key code.
My problem arises when I shifted the whole app and used SWT components instead. As we know some of the keys returns a different key code now, which messes up the whole hotkeys function.
The initial solutions I've thought of are:
A. Use javax.swing.jtextfield as mycomponent listener instead of swt.widget.text
B. Add AWT listener to SWT component (if possible)
C. Create a class which re-maps all AWT keycodes to SWT and vice-versa.
I believe these are feasible solutions. I just want to check out with you guys if you have a brilliant idea on which I could work with. I'm only new to java and I could use some professional insights on this.
(besides, I think A is cheating. B I could not find a way to do yet. And C is a hassle job to do)
Cheers.
After some googling I've found class from JBoss Tools which might help you with mapping from AWT keycodes to SWT one's..
See KeyboardHelper class from JaCoCo project.

how to create Java gui application like this in netbeans

I am creating a Java desktop application where the user will enter his name and age and press next, like given below in image 1.
And the action would perform would be like given in the image below in image 2.
I went through all tutorials on the Netbeans site, but still I was not able find any solution. I want to build this application like what we see when we install some application on Windows, we select some option and press next and a new window will appear with the result or more options. Please somebody help me with step by step instruction.
I don't think you'll get as much out of "step by step" instructions as you will going through the tutorials and learning not only how to do what you're desire, but the whys and hows of what you're doing. That being said, you will want to go through several of the Java Swing tutorials to learn how to do this including
the CardLayout tutorial to see how to swap JComponents in a GUI.
The JTextField tutorial to see how to interact with JTextFields
The JButton and ActionListener tutorial to see how to interact with JButtons and how to respond to their presses.
Much of learning to code means independent study and much trial and error. So start experimenting and have fun doing so!
As the above answer says, the CardLayout is a one way of doing this. However, in my case, I find that cardlayout is bit difficult for me. So, what I do is, creating JavaBeans, which extends JPanel, in this case. So you can add them to the main view and dispose/replace with another JavaBean, making different "Next" views. This way will help you to seperate your code into several classes, making the code simple too.
This article contains more or less a step-by-step tutorial on how to create a wizard in Swing. But before you start with that article make sure you have some basic Swing knowledge or that article will be complete Gibberish
You can use installation wizard creator tool for make a setup of your java application
for examaple you can use
"Setup Factory" tool for create a install exe of your application
it make a installer like that which you in your quetion

Java Swing: how to create assist functionality to teach user how to use the software?

Is there a library out there that can facilitate in creating assist or automated guide that tells users what action to take?
Like it should notice the user is running the software for the first time so it will say click this button, and when the user does, it will explain other features.
sort of like what Youtube's video editor does but I wonder if this is achievable in swing.
I don't know what you call this...but below is a good example to aim for but something that works for Java Swing.
http://jeffpickhardt.com/guiders/
I would do this using JPanel or image and mouse events by setting their visbility properties. I haven't tried it but, I think I can...
I used these libraries which are for rich applications
http://java.net/projects/animatedtransitions/
http://java.net/projects/timingframework/
let me know if you found anything new.
thanks
from
vinay

Making label creators in Java

I want to create a tool in java that can be used to create labels for consumer products. This is similar to CD label creators. What are the techniques available for doing this and guide me in a good direction so that i can walk through perfectly. If you just give me some tips i will start coding on it.
Here are some tutorials that should get you started, using AWT Print and Graphics2D:
Swing Tutorial - High-Quality Java Printing
Printing - Java Tutorials by Sun/Oracle
Using the 2D graphics API means you'll be able to render the result on-screen as well as print it. This will be significantly easier if you already know something about AWT or Swing.

How can I create a frame which includes animation?

I have a frame and I want to show some white sphere in the different location in my frame,I have researched a lot but I found some codes for using applets but i don't want to use applets.
please help me with some code or references.
Thanks.
Sun has published a large list of Java 2D examples, many of which include animation. You should be able to copy the techniques used there. Take a look!
Note: "Java 2D" sounds like some API that you'd need to download a new library for. This is not the case: Java 2D is part of the "normal" JDK/JRE libraries.
Another note: There's not too much difference between an Applet showing graphics and a desktop application. To convert a Swing Applet to a desktop application, most of the effort is replacing JApplet with JFrame, and moving the applet's init code into the JFrame's constructor. So if you see example code for applets, don't throw it out the window as it can still be useful to you.
You may also like this Java 2D games tutorial that discusses several animation techniques.

Categories