I'm creating some help content for an application (built on NetBeans), and thought it would be useful in some cases to be able do show a tutorial video within the JavaHelp or have a link to open a video.
I'd imagine it would be possible using the <OBJECT> tag perhaps, but I don't know which object to embed. What little I know of JavaHelp I've gotten from http://download.java.net/javadesktop/javahelp/jhug.pdf, and from that I conclude that I should get some Lightweight Java Component capable of playing a .avi and embed it with the <object> tag. Or rather have a link in the help that opens the .avi in a seperate window.
Does anyone have any pointers on how this is done?
Edit:
I've tried some more on adding a lightweight component of my own, but to no success. So I wonder if I'm placing the component in the wrong place. If i try to add a JButton to the JavaHelp with
<object
classid="java:javax.swing.JButton">
</object>
it appears in the JavaHelp just fine.
if I try a button of my own, like
<object
classid="java:my.module.TestButton">
</object>
I just get a couple of red "???"
The class TestBytton is just
package my.module;
import javax.swing.JButton;
public class TestButton extends JButton{
}
The TestButton lies in the same NetBeans project as the javahelp-html, and the package the TestButton lies in is public. Any ideas?
Edit2:
Ok, so i've looked into this some more. It seems that eventually the class com.sun.java.help.impl.CustomKit$CustomDocument will try to do a
getClass().getClassLoader().loadClass("my.module.TestButton")
And that will result in a ClassNotFoundException. That might be if i understood it correctly because the classloader that will be used will only find classes that are in the
netbeans module called JavaHelp Integration. And among those are not my.module.TestButton. So... I'm stuck once more. I don't think i can add anything to that module easily.
.
I do not know of any way to embed video in JavaHelp this way. But you should be able to create a regular hyperlink to an HTML file embedding the video (in some manner), for use from an external browser. http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-javahelp/org/netbeans/api/javahelp/doc-files/api.html#external-links shows how to make the links.
If you want this to work offline, include the HTML in your NBM fileset and use the nbinst URL protocol; for example, if in release/docs/helpvid.html in sources (for an Ant-based NBM project), nbinst://my.module.code.name.base/docs/helpvid.html should link to it in the app's installation. As far as I know the JavaHelp module's link handler will convert the URL to an equivalent file-protocol URL before passing it to the configured web browser (defaulting to Desktop.browse on JDK 6+).
I know this is not the answer, but linking to some YouTube videos often is enought. And you get high quality videos without having to deploy them in the installer.
Related
An external java library is treated as "package only containing non Java resources" (as indicated by the white icons as opposed to brown; the description in quotes is taken from here). When I try to import the library it cannot be resolved, so it seems it really isn't being recognised (in other words it's not just a case of eclipse showing wrong icon).
Two people have commented that my screenshots are not helping, so let me explain the intention behind them. The first one above is to show the difference between how my libraries are displayed. Htmlparser is a folder with .java files just like SPMF and works fine. Commons-lang and vecmath are .jars. SPMF cannot be resolved when I try to import it. The reason the screenshot is cropped this way is to highlight that all of the folders in SPMF are showing white which apparently means they are not recognized.
This is only the second time I'm using an external library, but I think I did everything the same as the first time.
This screenshot is intended to show how SPMF is added at the moment.
The library I am trying to add is SPMF - more specifically the Hierarchical Clustering algorithm. This is only a minor component of SPMF but it's the best Hierarchical Clustering solution I could find. It works fine if I just import it into a new project. So I could just bodge it by moving my code into that project if I can't get it going otherwise.
I presume that if a package can form a standalone project then it can also be used as an external library - or am I wrong?
I'm sure it's a stupid mistake I'm making but I've had no luck with google. This is the nearest I could find; Refresh seems the only applicable solution and it doesn't help.
Edit, SPMF is also available as a jar, it's missing some features but not the ones I need. I've been able to add the jar and the import the algorithm I need. It's enough of a workaround for me to move on and keep going. But it's not a solution and the question remains open.
I am new to GWT. Followed the GWT docs to set up the Google plugin and the GWT designer in Eclipse "Juno" (V4.2). Created a Web application with the example code. It runs and displays nicely in Firefox:
Then I open the Java class that implements EntryPoint using the WindowBuilder, and the canvas shows something different. The input field label "Please enter your name:" is not visible, and the "Send" button is under the input field, rather than to its right. Screenshot below:
Since the whole point in using the GWT designer is to get the layout right visually, it is kind of disconcerting to see it not working in a WYSIWYG manner with the example code.
Question A: Is there a way of fixing this discrepancy? Are there some config files or HTML or CSS that perhaps need to be edited so that the designer's view matches what the browser would display when the example app is running?
Question B: Is the GWT designer working "as advertised" in your everyday practice? Can I trust this tool? If not, what alternatives would you recommend?
I found the GWT designer a pita tool on eclipse platform which takes memory hogging to whole new level even in comparison to GWT Hosted mode!!!!!
List of GWT Articles from Dev Guide on google.
Preferre Option at enterprise workplace
HTML/CSS/UIBinder for rich look and feel
Handcoded GWT Layouting and Widgets for complex gui behaviour/performance.
Edit - *GWT Designer is hardly updated/maintained* - I have seen only 10 odd checkins in a year. I wish i am wrong ( does google team not update the public svn !!! ) - https://code.google.com/p/gwt-designer/source/list
It becouse in the example project, Gwt inject widgets to existed html. So, you have one part of style in html, and second part in rendered gwt widgets. And it is looks ugly.
If you will use only gwt style approch (without any html styles, e.t.c), designer will be predictable and totaly wysiwyg.
I have a client who has a java based game which he wants to make available online (at the moment it is desktop version which he had to install). He asked me whether I can embed it into a webpage. After trying for several days still no joy. Can you please point me to the right direction. It have fives jar files(executable jar file) and a folder called lib which has five more jar files. Now I don't know whether it is possible to embed the game using applet/object tag. Can you please point me what to look at when dealing with these jar files.
..at the moment it is desktop version which he had to install..
Launch it from a link using Java Web Start. It might be necessary to digitally sign the Jars (what does the app. do?).
Note that a 'desktop application' would typically be coded using a JFrame, whereas the equivalent top-level container for embedding is a JApplet. A frame cannot simply be embedded in a web page.
As the rest of the problems mentioned, you'll need to be a lot more specific about what you tried and the results of those attempts, or find some psychic helpers.
I am working on a large undocumented application written in swing/awt. I have to make changes to it and i need to find out what class a form belongs to when i open it. Is there a way to do this via eclipse?
For example: I open the application and to do something with the app such that some frame opens. How do i find out the class of that form? Can this be done through eclipse?
I know i can comb trough the logic but this is a very laborious and largely ineffective process, chunks of the logic are either in jar files or obfuscated.
Thanks.
For figuring out how a given Swing frame is put together, I have found Swing Explorer to be VERY helpful.
https://swingexplorer.dev.java.net/
After installing the Eclipse plugin, note that you need to "Run as ->" to invoke Swing Explorer properly.
I don't know if this is what you need, but maybe you should try searching(MainMenu-->Search) your entire Project for the specific Window title (String) that comes up with this particular window.
i want to embed an open source editor to my java desktop application. But i am not sure yet how to do it. I got jnlp web start and jar file to import library.
The program which will be imported is like below.
In fact i just need internal frames but if it is too completed i can embed whole program too.
I think about 3 options but don't know which one really works and which one is better.
Run jnlp webstart in java code
Run jar file in java code(non-executable jar)
Import jar and use its api (This is really what i need but i m not sure how to do this. I debugged the code to understand which frame works how but i have no experience about it and i found it very complicated)
Any advices how to solve this problem ?
Thanks,
Bilal
The picture just shows the view but there's more behind. You can't just embed the internal frames into you application and use the editors functionality. You'll need all the model, controller, support, ... classes too.
You may be lucky, that the main frame is just a simple container and you can "replace" it with your own container. But I not too optimistic. I don't think, that the editor has an API that allows integrating the internal frames into another container. So Option 3 would be the best but I think it's out of reach. Is it a common editor? Maybe more help is possible if you just tell us its name.