|
David is absolutely right....I myself is new to Java and, is learning java in my university and we are using Notepad++ to create GUIs for java applications, would you believe this?? There is alot of pain in this technique....lolzz. But congratulations, if you adopt this technique, you will have very good idea what is going on behind the scenes.
|
|
|
|
|
it's remind me my early days of first year while i was using with jcreator
|
|
|
|
|
igalep132 wrote: do you have any advice for a preferred one ?
No. I don't use them so I can't recommend one.
igalep132 wrote: i assume that some swing plugin required for see swing interface
No, sorry if I wasn't clear. Eclipse is capable of running Swing, because it is a standard part of Java. What Eclipse is missing is a visual designer, that lets you build a screen by dragging and dropping components. For that you need a plugin, but Eclipse is perfectly capable of compiling and running Swing code without any plugins.
igalep132 wrote: and there is no possibility to change the code ?
Yes there is, but (a) it uses a special layout manager (GroupLayout) which is not really intended to be coded manually so might be a bit tricky and (b) as soon as you change the code manually you will not be able to use the visual designer any more.
As far as books goes, you could try the Sun tutorial which is a decent starter and covers the basics pretty well:
http://www.amazon.com/JFC-Swing-Tutorial-Guide-Constructing/dp/0201914670/ref=sr_1_12?ie=UTF8&s=books&qid=1271752168&sr=1-12[^]
There are others. Search Google and see what comes up.
|
|
|
|
|
hello guys....im trying to close the JFrame with a JButton on it. Im unable to make a logic...will it be useful to make an inner class for WindowAdapter and use it in the actionPerformed() function (used by JButton's ActionListener) ??
|
|
|
|
|
Hello Friend,
I dont no more in java, but got a job to do.
can anyone tell me alternate of MouseTranslate for paning(moving object) in viewer on mouse first button. as MouseTranslate is a Java3D behavior object that lets users control the translation (X, Y) of an object via a mouse drag motion with the third mouse button.
i want same in first button
plese help me
Thanks
Shafiq
|
|
|
|
|
Hello Friends
I am creating a submenu under menu and that subMenu having an array of MenuItems(Suppose 5).And When I click on any one of its 5 subMenuItem,I want to delete that SubMenuItem from that subMenu.I know that there is function like remove with different parameters like position,component but on the click of that submenuitem,I only get its event,and tht event produces the name of tht subMenuItem but removeItem doesnt take any parameter like string.
How can I delete that particular clicked SubMenuItem?
Thanks IN Advance.
Regards
Yogesh
|
|
|
|
|
Project I am working on has a courtesy Weather.com Page. The intent is to display the client side weather conditions--not the server.
The HTML code from Weather.com looks like this:
<script type="text/javascript">
</script>
<div id="wx_module_7847" style="padding-left: 225px;" >
if (!document.cookie && document.cookie != "") {
Alert("Cookies must be enabled in Internet Explorer to use Weather.com<br />in the Aloha Manager's Desktop.")
}
if (!document.amdczip && document.amdczip != "") {
createCookie('amdczip', '40212', 365)
}
var wczip = readCookie('amdczip')
document.write('wczip')
<a href="http://www.weather.com/weather/local/34979">Your City's Weather Forecast, AA (11111)</a>
</div>
<script type="text/javascript">
/* Locations can be edited manually by updating 'wx_locID' below. Please also update */
/* the location name and link in the above div (wx_module) to reflect any changes made. */
var wx_locID = '08043';
/* If you are editing locations manually and are adding multiple modules to one page, each */
/* module must have a unique div id. Please append a unique # to the div above, as well */
/* as the one referenced just below. If you use the builder to create individual modules */
/* you will not need to edit these parameters. */
var wx_targetDiv = 'wx_module_7847';
/* Please do not change the configuration value [wx_config] manually - your module */
/* will no longer function if you do. If at any time you wish to modify this */
/* configuration please use the graphical configuration tool found at */
/* https://registration.weather.com/ursa/wow/step2 */
var wx_config = 'SZ=300x250*WX=FHW*LNK=SSNL*UNT=F*BGI=spring*MAP=null|null*DN=askbillbradley.com*TIER=0*PID=1177763389*MD5=be2899d91f6feddef8216cd03ec459a7';
document.write('<scr' + 'ipt src="' + document.location.protocol + '//wow.weather.com/weather/wow/module/' + wx_locID + '?config=' + wx_config + '&proto=' + document.location.protocol + '&target=' + wx_targetDiv + '"></scr' + 'ipt>');
</script>
The VAR var wx_locID can be changed under license. However, I am having a difficult time requesting a Zip Code using a form/input, saving it as a cookie for future use, retreiving that cookie and assigning its value to the var wx_locID.
It var exists inside a script. I cannot modify that script per weather.com terms and conditions, but I need to pass the zipcode to it.
Any assistance would be appreciated.
|
|
|
|
|
Wrong forum. JavaScript is not Java. If you post this in the Web Development forum you will stand a better chance of getting an answer.
|
|
|
|
|
hello guys...im trying to make very simple browser in java. when i go to some page using JEditorPane, it then shows no support for cookies and some good graphics. How can i handle that?? any tutorials for that>?? thanx
|
|
|
|
|
JEditorPane and the HTMLEditorKit have limited functionality. As far as I am aware there is no support for JavaScript or coookies.
There are plenty of tutorials for JEditorPane and if you search for "JEditorPane tutorial" on Google you will find lots of them.
Alternatively, you could look at the JDIC project which includes a component to embed the native browser into a Java application.
|
|
|
|
|
hello.
first of all - apologies for my poor English.
I wrote a small program in javaFX . (NetBeans as IDE)
Now, say I want to run it from my desktop, or pass it to a friend.
Here is what I did so far:
NetBeans creats an executable jar file. (mine is called "classroom")
I wrote the cmd command: java -jar classroom.jar
it gave me this:
"exeption in thread "main" java.lang.NoClassDefFoundError : com/sun/javafx/runtime/FXObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(UnKnown Source)
.
. // a few more of these
.
// and in the end It says:
Could not find the main class: classroom.Main. program will exit "
( I have a screen picture of the massage but I didn't find a way to add it to this post ).
if the file is called an "executable jar file" doesn't it mean that it contains the main class? or the necassary manifast file?
thanks
|
|
|
|
|
run
in
debug
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
that's JavaFX - not Java.
try this:
http://javafx.com/docs/techtips/deployment_toolkit/
greets
Torsten
I never finish anyth...
|
|
|
|
|
Hello Friends
I created a viewer in applet and embed into html.This viewer having differnt button that controls zooming,panning,moving.Now,I want to know that Is it possible to have all these buttons on same HTML page on which I embed the viewer to control the viewer zooming all things?
Thanks & Regards
Yogesh
|
|
|
|
|
Yogesh!
Honestly - you have worked a lot on this, I noticed quit some posts of you.
As much as you have been working with JAVA, you should have noticed at least some GUI-examples. And as you did so, you should have taken notice of the existens of the JPanel.
Java Tutorials[^]
Example with multible JPanels
Please check the JPanel which is mounted in the south-position of the BorderLayout:
public class DynamicTreePanel extends JPanel implements ActionListener {
private int newNodeSuffix = 1;
private static String ADD_COMMAND = "add";
private static String REMOVE_COMMAND = "remove";
private static String CLEAR_COMMAND = "clear";
private DynamicTree treePanel;
public DynamicTreePanel() {
super(new BorderLayout());
treePanel = new DynamicTree();
populateTree(treePanel);
JButton addButton = new JButton("Add");
addButton.setActionCommand(ADD_COMMAND);
addButton.addActionListener(this);
JButton removeButton = new JButton("Remove");
....
JButton clearButton = new JButton("Clear");
...
treePanel.setPreferredSize(new Dimension(300, 150));
add(treePanel, BorderLayout.CENTER);
JPanel panel = new JPanel(new GridLayout(0,3));
panel.add(addButton);
panel.add(removeButton);
panel.add(clearButton);
add(panel, BorderLayout.SOUTH);
}
....
}
I never finish anyth...
|
|
|
|
|
Hello Torsten
Thx a Lot.Its my pleasure that somebody is noticing My work and get reward like this.Basically,I worked on C++ project but as sudden as per requiremnt I have to work with java3d and obviously we need core java too.And I learned from u guys only.
Now,the code u suggested will create a button in jpanel that will b part of Applet.And I also looked at setActionCommand tht just records the string.
Suppose a button in applet zooms the object.but after embeding tht applet into browser,I want now the same button as html button tht will zoom the object of applet inspite of that button in the applet.
I want to control the Jbutton thru html button.
Any other Ideas.
Thanks Again
Regards
Yogesh
|
|
|
|
|
Hello Guys
I got one link in which we can call java public method from javascript but I want to know that how can i call same method if I m specifying jar file thru jnlp file in html code.
this is the link,u will find tht how can u create an object and call public method of java file.
but i need ideas with jar file.
Regards
yogesh
|
|
|
|
|
Hello guys
I got it .
To control java methods with javaScript code when u have jar file then just define ur applet tag in html like this
<applet code = 'packageName.MainClassName'
archive = 'test.jar',
id='viewer',
width = 200,
height = 200 />
</applet>
<input type="button" value="Animate" onClick="pass();">
function pass()
{
var tViewer = document.getElementById('viewer');
tViewer.methodName();
}
Like this,u can call whatever method u want to call.
|
|
|
|
|
I want a Javascript code for my webpage, which performs following action:
resize window to (100, 100)
disable any further Resizing,
disable toolbars,
disable scrolling....
Actually a code which forces the user to close the window.....
It become difficult for him to proceed further...
Please help me..please
|
|
|
|
|
sangeeta2009 wrote: I want a Javascript code for my webpage
This is the Java forum; try elsewhere.
It's time for a new signature.
|
|
|
|
|
|
Hello,
I am trying to do a Shorst Remaning Time First Algorithm in java. I need help on how i can start implemnting.
Thank you
|
|
|
|
|
Blackberry89 wrote: I need help on how i can start
Start with a better question; this one is not very clear.
It's time for a new signature.
|
|
|
|
|
i have got 5 randomly generated numbers in a queue. I want the smallest number in the queue to be displayed. After this another random number will be generated and i want it to be compared against the queue and from that the smallest number be displayed. The code so far is below:
import java.util.ArrayList;
import java.util.Iterator;
public class Assign1 {
private final int MAX_QUEUE_SIZE = 5;
private final int NO_SIMULATIONS_TO_RUN = 7;
private int maxSize;
private double[] queArray;
private int nItems;
public static void main( String args[] ) {
new Assign1().runSimulation();
}
public void runSimulation() {
PriorityQueue queue = new PriorityQueue();
initQueue(queue);
for (int i = 0; i < NO_SIMULATIONS_TO_RUN; i++) {
System.out.println( "The numbers in the queue are: " + queue.toString());
System.out.println( "The current dispatched number is " + queue.poll());
queue.remove();
int item = getRandomNumber();
System.out.println( "The new coming number is " + item );
queue.add(item);
System.out.print( "\n\n" );
}
}
private void initQueue(PriorityQueue queue){
for (int i = 0; i < MAX_QUEUE_SIZE; i++)
queue.add(getRandomNumber());
}
public static int getRandomNumber(){
return 1 + ( int ) ( Math.random() * 100 );
}
private class PriorityQueue extends ArrayList {
public void add(int val){
super.add(new Integer(val));
}
public int poll(){
return ((Integer) iterator().next()).intValue();
}
public String toString(){
StringBuffer buff = new StringBuffer();
Iterator it = iterator();
buff.append("[");
while (it.hasNext()) {
buff.append(it.next());
if (it.hasNext())
buff.append(", ");
}
buff.append("]");
return buff.toString();
}
public void remove(){
if (!isEmpty())
remove(0);
}
}
}
|
|
|
|
|
so your method poll() should give the smallest number in the Array. OKOK.
You need to compare the numbers in your Array, start with first number and compareTo the other numbers - as long as you do not find a smaller number. IF so, use this number as comparsion and continue. When you reach the end of the Array the comparsion should be the number searched for.
shouldn*t be that hard to figure out
Remember to modify the mechanism for the exchange of the found number.
greets
Torsten
I never finish anyth...
|
|
|
|