Re: How do I compile this jar file
Thanks - I added the constructor code:
Code:
f2 = new DragArea(this);
Here are the 2 sets of deompiled code:
Code:
public final void reportProblem(String paramString)
{
if (paramString.equals(""))
{
this.problemField.setText("");
return;
}
this.problemField.setText(paramString);
Jabble tmp31_30 = this;
if (tmp31_30 == null)
throw null;
new Jabble.Reminder(tmp31_30, 3);
}
public final void reportProblem(String s)
{
if(s.equals(""))
{
problemField.setText("");
return;
} else
{
problemField.setText(s);
Jabble tmp31_30 = tmp31_30;
if (tmp31_30 == null)
throw null;
new Jabble.Reminder(tmp31_30, 3);
return;
}
}
I don't have the file com.symbian.devnet.util.ELocale. Not sure what you mean by:
Code:
Try removing the package declaration and make sure the jar containing the imported file is on the class path.
I have 'hidden' it by putting 2 // in front of it??
Re: How do I compile this jar file
Again this is just an educated guess as I haven't studied all of the code but it looks like it should be:
Code:
public final void reportProblem(String paramString)
{
problemField.setText(paramString);
if (paramString.equals(""))
{
return;
}
new Jabble.Reminder(3);
}
Quote:
I don't have the file com.symbian.devnet.util.ELocale.
The class is importing it so unless the import is superfluous the compile will fail without this file. If it is a real import then the file must be on the class path or the original app would have failed when it tried to access it. Try removing this import statement and see if the compiler complains about not finding the class.
Alternatively, Netbeans probably will be able to auto generate import statements (Eclipse can certainly do this) so try running the auto-generate import statements feature and see if it complains about a class it can't resolve.
Quote:
I have 'hidden' it by putting 2 // in front of it??
Yes, that will work.
Re: How do I compile this jar file
Hi keang,
Good news - we are making progress!! The game now works in debug mode!! However, the downside is that it will still not compile properly (as you suspected) because of the errors in the file ToolbarFrame.
Here's an update.
1) Your new code worked great - thanks
2) I couldn't work out how to create an auto-statement in NetBeans so, I took a long cut for a shortcut and downloaded Eclipse. Long story short I created a new java file called ELocale.java with the following code:
Code:
package com.symbian.devnet.util;
public class ELocale
{
class startNotifier
{
}
}
3) I then done a build and compile but NetBeans generates 45 errors as follows:
Code:
init:
deps-clean:
Updating property file: C:\Users\User1\Desktop\JabbleDev\build\built-clean.properties
Deleting directory C:\Users\User1\Desktop\JabbleDev\build
clean:
init:
deps-jar:
Created dir: C:\Users\User1\Desktop\JabbleDev\build
Updating property file: C:\Users\User1\Desktop\JabbleDev\build\built-jar.properties
Created dir: C:\Users\User1\Desktop\JabbleDev\build\classes
Created dir: C:\Users\User1\Desktop\JabbleDev\build\empty
Compiling 23 source files to C:\Users\User1\Desktop\JabbleDev\build\classes
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:18: cannot find symbol
symbol: class EFrame
public class ToolbarFrame extends EFrame
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:33: cannot find symbol
symbol : method getBounds()
location: class ToolbarFrame
TOOLBAR_HEIGHT = getBounds().height;
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:46: package super does not exist
super.aboutDialog.setTitle("About the Toolbar Frame");
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:47: package super does not exist
super.aboutDialog.text = dialogText;
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:49: addActionListener(java.awt.event.ActionListener) in java.awt.MenuItem cannot be applied to (ToolbarFrame)
showToolbarItem.addActionListener(this);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:51: addItemListener(java.awt.event.ItemListener) in java.awt.CheckboxMenuItem cannot be applied to (ToolbarFrame)
leftToolbarItem.addItemListener(this);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:52: package super does not exist
super.menuBar.add(viewMenu);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:88: cannot find symbol
symbol : method getToolkit()
location: class ToolbarFrame
RIGHT_SHIFT = getToolkit().getScreenSize().width - 68;
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:96: package super does not exist
super.mainPanel.addComponentListener(new _cls2());
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:97: package super does not exist
super.mainPanel.setBounds(0, 0, RIGHT_SHIFT + 1, TOOLBAR_HEIGHT);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:98: package super does not exist
f1 = super.mainPanel.getSize().width;
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:99: cannot find symbol
symbol : method setLayout(<nulltype>)
location: class ToolbarFrame
setLayout(null);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:100: cannot find symbol
symbol : method add(java.awt.Panel,java.lang.String)
location: class ToolbarFrame
add(panel, panel.getName());
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:103: cannot find symbol
symbol : variable ELocale
location: class ToolbarFrame
ELocale.startNotifier();
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:131: package super does not exist
if(!f2 && super.mainPanel.getSize().width == f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:132: cannot find symbol
symbol : variable super
location: class ToolbarFrame
m1(super.mainPanel, 67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:134: package super does not exist
if(f2 && super.mainPanel.getSize().width == f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:135: package super does not exist
super.mainPanel.setBounds(0, 0, super.mainPanel.getSize().width + 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:135: operator + cannot be applied to super.mainPanel.getSize.width,int
super.mainPanel.setBounds(0, 0, super.mainPanel.getSize().width + 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:135: package super does not exist
super.mainPanel.setBounds(0, 0, super.mainPanel.getSize().width + 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:135: package super does not exist
super.mainPanel.setBounds(0, 0, super.mainPanel.getSize().width + 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:137: package super does not exist
if(f2 && super.mainPanel.getSize().width > f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:139: cannot find symbol
symbol : variable super
location: class ToolbarFrame
m2(super.mainPanel, 67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:140: package super does not exist
super.mainPanel.setLocation(0, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:146: package super does not exist
if(!f2 && super.mainPanel.getSize().width > f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:147: cannot find symbol
symbol : variable super
location: class ToolbarFrame
m2(super.mainPanel, 67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:149: package super does not exist
if(f2 && super.mainPanel.getSize().width == f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:150: package super does not exist
super.mainPanel.setLocation(67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:152: package super does not exist
if(f2 && super.mainPanel.getSize().width > f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:153: package super does not exist
super.mainPanel.setBounds(67, 0, super.mainPanel.getSize().width - 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:153: package super does not exist
super.mainPanel.setBounds(67, 0, super.mainPanel.getSize().width - 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:153: package super does not exist
super.mainPanel.setBounds(67, 0, super.mainPanel.getSize().width - 67, super.mainPanel.getSize().height);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:155: cannot find symbol
symbol : variable super
location: class ToolbarFrame
super.actionPerformed(actionevent);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:169: package super does not exist
super.mainPanel.setLocation(67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:171: package super does not exist
if(super.mainPanel.getSize().width > f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:172: cannot find symbol
symbol : variable super
location: class ToolbarFrame
m2(super.mainPanel, 67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:174: cannot find symbol
symbol : method repaint()
location: class ToolbarFrame
repaint();
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:177: package super does not exist
if(super.mainPanel.getSize().width > f1)
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:178: cannot find symbol
symbol : variable super
location: class ToolbarFrame
m2(super.mainPanel, 67, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:179: package super does not exist
super.mainPanel.setLocation(0, 0);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:182: cannot find symbol
symbol : method repaint()
location: class ToolbarFrame
repaint();
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:192: cannot find symbol
symbol : method repaint()
location: class ToolbarFrame
repaint();
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:197: cannot find symbol
symbol : method setVisible(boolean)
location: class ToolbarFrame
(new ToolbarFrame()).setVisible(true);
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:235: cannot find symbol
symbol : variable TaskSwitch
location: class ToolbarFrame._cls1
TaskSwitch.displayTaskList();
C:\Users\User1\Desktop\JabbleDev\Jabble.src\ToolbarFrame.java:249: cannot find symbol
symbol : class EFrame
location: class ToolbarFrame._cls2
((EFrame) (f1)).mainPanel.validate();
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
45 errors
C:\Users\User1\Desktop\JabbleDev\nbproject\build-impl.xml:413: The following error occurred while executing this line:
C:\Users\User1\Desktop\JabbleDev\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 3 seconds)
4) I have attached a screenshot of work in progress.
5) The game is working very well in debug mode and the only thing that doesn't seem to be working is alignment of the letters (they are aligned left rather than centre), other than that it is going great guns.
6) Here is the code from the ToolbarFrame java file for reference
Code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
package com.symbian.devnet.awt;
import com.symbian.devnet.util.ELocale;
import java.awt.*;
import java.awt.event.*;
import java.text.SimpleDateFormat;
import java.util.*;
// Referenced classes of package com.symbian.devnet.awt:
// EFrame
public class ToolbarFrame extends EFrame
implements ItemListener, ActionListener
{
public ToolbarFrame()
{
this("");
}
public ToolbarFrame(String s)
{
super(s);
appName = System.getProperty("com.symbian.appName");
if(appName.length() > 10)
appName = appName.substring(0, 10);
TOOLBAR_HEIGHT = getBounds().height;
TOOLBAR_WIDTH = 68;
BUTTON_HEIGHT = 37;
TITLE_BAR_HEIGHT = 24;
CLOCK_BAR_HEIGHT = TOOLBAR_HEIGHT - 24 - 148;
viewMenu = new Menu("View");
showToolbarItem = new MenuItem("Hide toolbar", new MenuShortcut(84));
leftToolbarItem = new CheckboxMenuItem("Left toolbar", false);
f2 = false;
dummy = new Date();
cal = new GregorianCalendar();
df = new SimpleDateFormat("HH:mm\nEE d");
lastdate = df.format(dummy);
super.aboutDialog.setTitle("About the Toolbar Frame");
super.aboutDialog.text = dialogText;
viewMenu.add(showToolbarItem);
showToolbarItem.addActionListener(this);
viewMenu.add(leftToolbarItem);
leftToolbarItem.addItemListener(this);
super.menuBar.add(viewMenu);
Label1 = new Label();
Label1.setName("Label1");
Label1.setAlignment(1);
Label1.setFont(new Font("dialog", 1, 12));
Label1.setText(appName);
Label1.setBackground(Color.white);
Label1.setBounds(1, 1, 66, 24);
Label1.addMouseListener(new _cls1());
Button1 = new Button();
Button1.setName("Button1");
Button1.setBounds(0, 25, 68, 37);
Button1.setLabel("Cmd1");
Button2 = new Button();
Button2.setName("Button2");
Button2.setBounds(0, 62, 68, 37);
Button2.setLabel("Cmd2");
Button3 = new Button();
Button3.setName("Button3");
Button3.setBounds(0, 99, 68, 37);
Button3.setLabel("Cmd3");
Button4 = new Button();
Button4.setName("Button4");
Button4.setBounds(0, 136, 68, 37);
Button4.setLabel("Cmd4");
Label2 = new Label();
Label2.setName("Label2");
Label2.setAlignment(1);
Label2.setFont(new Font("dialog", 1, 14));
displayTime();
Label2.setBackground(Color.white);
Label2.setBounds(1, 173, 66, CLOCK_BAR_HEIGHT - 2);
panel = new Panel();
panel.setName("panel");
panel.setLayout(null);
panel.setBackground(Color.black);
RIGHT_SHIFT = getToolkit().getScreenSize().width - 68;
panel.setBounds(RIGHT_SHIFT, 0, 68, TOOLBAR_HEIGHT);
panel.add(Label1, Label1.getName());
panel.add(Button1, Button1.getName());
panel.add(Button2, Button2.getName());
panel.add(Button3, Button3.getName());
panel.add(Button4, Button4.getName());
panel.add(Label2, Label2.getName());
super.mainPanel.addComponentListener(new _cls2());
super.mainPanel.setBounds(0, 0, RIGHT_SHIFT + 1, TOOLBAR_HEIGHT);
f1 = super.mainPanel.getSize().width;
setLayout(null);
add(panel, panel.getName());
try
{
ELocale.startNotifier();
}
catch(RuntimeException runtimeexception)
{
System.err.println(runtimeexception.getMessage());
System.exit(0);
}
timer = new _cls3();
timer.start();
}
private void m1(Component component, int i, int j)
{
component.setSize(component.getSize().width + i, component.getSize().height + j);
}
private void m2(Component component, int i, int j)
{
component.setSize(component.getSize().width - i, component.getSize().height - j);
}
public void actionPerformed(ActionEvent actionevent)
{
if(actionevent.getSource() == showToolbarItem)
if(panel.isVisible())
{
panel.setVisible(false);
showToolbarItem.setLabel("Show toolbar");
if(!f2 && super.mainPanel.getSize().width == f1)
m1(super.mainPanel, 67, 0);
else
if(f2 && super.mainPanel.getSize().width == f1)
super.mainPanel.setBounds(0, 0, super.mainPanel.getSize().width + 67, super.mainPanel.getSize().height);
else
if(f2 && super.mainPanel.getSize().width > f1)
{
m2(super.mainPanel, 67, 0);
super.mainPanel.setLocation(0, 0);
}
} else
{
panel.setVisible(true);
showToolbarItem.setLabel("Hide toolbar");
if(!f2 && super.mainPanel.getSize().width > f1)
m2(super.mainPanel, 67, 0);
else
if(f2 && super.mainPanel.getSize().width == f1)
super.mainPanel.setLocation(67, 0);
else
if(f2 && super.mainPanel.getSize().width > f1)
super.mainPanel.setBounds(67, 0, super.mainPanel.getSize().width - 67, super.mainPanel.getSize().height);
}
super.actionPerformed(actionevent);
}
public void itemStateChanged(ItemEvent itemevent)
{
if(itemevent.getSource() == leftToolbarItem)
{
if(!panel.isVisible())
{
panel.setVisible(true);
showToolbarItem.setLabel("Hide toolbar");
}
if(itemevent.getStateChange() == 1)
{
super.mainPanel.setLocation(67, 0);
panel.setLocation(0, 0);
if(super.mainPanel.getSize().width > f1)
m2(super.mainPanel, 67, 0);
f2 = true;
repaint();
return;
}
if(super.mainPanel.getSize().width > f1)
m2(super.mainPanel, 67, 0);
super.mainPanel.setLocation(0, 0);
panel.setLocation(RIGHT_SHIFT, 0);
f2 = false;
repaint();
}
}
public void displayTime()
{
dat = new Date();
cal.setTime(dat);
today = df.format(dat);
Label2.setText(today);
repaint();
}
public static void main(String args[])
{
(new ToolbarFrame()).setVisible(true);
}
String dialogText[] = {
"--" + System.getProperty("com.symbian.appName") + "--", "Version 1.1, 31st January 2000"
};
public String appName;
public Label Label1;
public Label Label2;
public Button Button1;
public Button Button2;
public Button Button3;
public Button Button4;
public Panel panel;
private static int f1;
final int TOOLBAR_HEIGHT;
final int TOOLBAR_WIDTH;
final int BUTTON_HEIGHT;
final int TITLE_BAR_HEIGHT;
final int CLOCK_BAR_HEIGHT;
static int RIGHT_SHIFT;
public Menu viewMenu;
public MenuItem showToolbarItem;
public CheckboxMenuItem leftToolbarItem;
private boolean f2;
Thread timer;
Date dummy;
GregorianCalendar cal;
SimpleDateFormat df;
String lastdate;
Date dat;
String today;
private class _cls1 extends MouseAdapter
{
public void mousePressed(MouseEvent mouseevent)
{
TaskSwitch.displayTaskList();
}
_cls1()
{
}
}
private class _cls2 extends ComponentAdapter
{
public void componentResized(ComponentEvent componentevent)
{
((EFrame) (f1)).mainPanel.validate();
}
private final ToolbarFrame f1;
_cls2()
{
f1 = ToolbarFrame.this;
}
}
private class _cls3 extends Thread
{
public void run()
{
while(f1.timer != null)
{
try
{
Thread.sleep(100L);
}
catch(InterruptedException _ex) { }
f1.displayTime();
}
}
private final ToolbarFrame f1;
_cls3()
{
f1 = ToolbarFrame.this;
}
}
}
Any thoughts on removing the errors from ToolbarFrame?
As always keang, thanks for your time and expertise - much appreciated
Re: How do I compile this jar file
As I said before you must have the ELocale class in the original distribution or the original program would not work. Are there any other jar files in the distribution?
In the version of the ELocale class you have written startnotifier() should be a method and not an inner class.
The other problems mainly stem from the fact that you don't seem to have the class EFrame either.
Before you go any further you will need to find these class files. If you haven't got them try searching for the full package name and class file name on the internet.
Re: How do I compile this jar file
I have checked and double-checked the original distribution - there are definitely no additional class files called ELocale and EFrame and there are no additional jar files included either, yet the program runs fine without them? This would fit in with the decompiled version I am using in NetBeans - it runs fine in debug mode but won't compile because of the broken references?
Is it possible to remove the references to the ELocale and EFrame to allow it to compile without error, as I don't the files are needed?
I don't know what you mean by searching for the full package name?
Re: How do I compile this jar file
ToolbarFrame extends EFrame and from looking at the code EFrame has functionality that maybe required. You could try changing ToolbarFrame so it extends Frame and lose some of the funtionality such as the about dialog. Such as this:
Code:
//Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
//Jad home page: http://www.kpdus.com/jad.html
//Decompiler options: packimports(3)
import java.awt.Button;
import java.awt.CheckboxMenuItem;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Label;
import java.awt.Menu;
import java.awt.MenuItem;
import java.awt.MenuShortcut;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
//Referenced classes of package com.symbian.devnet.awt:
// EFrame
public class ToolbarFrame extends Frame
implements ItemListener, ActionListener
{
public ToolbarFrame()
{
this("");
}
public ToolbarFrame(String s)
{
super(s);
appName = System.getProperty("com.symbian.appName");
if(appName.length() > 10)
appName = appName.substring(0, 10);
TOOLBAR_HEIGHT = getBounds().height;
TOOLBAR_WIDTH = 68;
BUTTON_HEIGHT = 37;
TITLE_BAR_HEIGHT = 24;
CLOCK_BAR_HEIGHT = TOOLBAR_HEIGHT - 24 - 148;
viewMenu = new Menu("View");
showToolbarItem = new MenuItem("Hide toolbar", new MenuShortcut(84));
leftToolbarItem = new CheckboxMenuItem("Left toolbar", false);
f2 = false;
dummy = new Date();
cal = new GregorianCalendar();
df = new SimpleDateFormat("HH:mm\nEE d");
lastdate = df.format(dummy);
// super.aboutDialog.setTitle("About the Toolbar Frame");
// super.aboutDialog.text = dialogText;
viewMenu.add(showToolbarItem);
showToolbarItem.addActionListener(this);
viewMenu.add(leftToolbarItem);
leftToolbarItem.addItemListener(this);
getMenuBar().add(viewMenu);
Label1 = new Label();
Label1.setName("Label1");
Label1.setAlignment(1);
Label1.setFont(new Font("dialog", 1, 12));
Label1.setText(appName);
Label1.setBackground(Color.white);
Label1.setBounds(1, 1, 66, 24);
Label1.addMouseListener(new _cls1());
Button1 = new Button();
Button1.setName("Button1");
Button1.setBounds(0, 25, 68, 37);
Button1.setLabel("Cmd1");
Button2 = new Button();
Button2.setName("Button2");
Button2.setBounds(0, 62, 68, 37);
Button2.setLabel("Cmd2");
Button3 = new Button();
Button3.setName("Button3");
Button3.setBounds(0, 99, 68, 37);
Button3.setLabel("Cmd3");
Button4 = new Button();
Button4.setName("Button4");
Button4.setBounds(0, 136, 68, 37);
Button4.setLabel("Cmd4");
Label2 = new Label();
Label2.setName("Label2");
Label2.setAlignment(1);
Label2.setFont(new Font("dialog", 1, 14));
displayTime();
Label2.setBackground(Color.white);
Label2.setBounds(1, 173, 66, CLOCK_BAR_HEIGHT - 2);
panel = new Panel();
panel.setName("panel");
panel.setLayout(null);
panel.setBackground(Color.black);
RIGHT_SHIFT = getToolkit().getScreenSize().width - 68;
panel.setBounds(RIGHT_SHIFT, 0, 68, TOOLBAR_HEIGHT);
panel.add(Label1, Label1.getName());
panel.add(Button1, Button1.getName());
panel.add(Button2, Button2.getName());
panel.add(Button3, Button3.getName());
panel.add(Button4, Button4.getName());
panel.add(Label2, Label2.getName());
addComponentListener(new _cls2());
setBounds(0, 0, RIGHT_SHIFT + 1, TOOLBAR_HEIGHT);
f1 = getSize().width;
setLayout(null);
add(panel, panel.getName());
timer = new _cls3();
timer.start();
}
private void m1(Component component, int i, int j)
{
component.setSize(component.getSize().width + i, component.getSize().height + j);
}
private void m2(Component component, int i, int j)
{
component.setSize(component.getSize().width - i, component.getSize().height - j);
}
public void actionPerformed(ActionEvent actionevent)
{
if(actionevent.getSource() == showToolbarItem)
if(panel.isVisible())
{
panel.setVisible(false);
showToolbarItem.setLabel("Show toolbar");
if(!f2 && getSize().width == f1)
m1(this, 67, 0);
else
if(f2 && getSize().width == f1)
setBounds(0, 0, getSize().width + 67, getSize().height);
else
if(f2 && getSize().width > f1)
{
m2(this, 67, 0);
setLocation(0, 0);
}
} else
{
panel.setVisible(true);
showToolbarItem.setLabel("Hide toolbar");
if(!f2 && getSize().width > f1)
m2(this, 67, 0);
else
if(f2 && getSize().width == f1)
setLocation(67, 0);
else
if(f2 && getSize().width > f1)
setBounds(67, 0, getSize().width - 67, getSize().height);
}
}
public void itemStateChanged(ItemEvent itemevent)
{
if(itemevent.getSource() == leftToolbarItem)
{
if(!panel.isVisible())
{
panel.setVisible(true);
showToolbarItem.setLabel("Hide toolbar");
}
if(itemevent.getStateChange() == 1)
{
setLocation(67, 0);
panel.setLocation(0, 0);
if(getSize().width > f1)
m2(this, 67, 0);
f2 = true;
repaint();
return;
}
if(getSize().width > f1)
m2(this, 67, 0);
setLocation(0, 0);
panel.setLocation(RIGHT_SHIFT, 0);
f2 = false;
repaint();
}
}
public void displayTime()
{
dat = new Date();
cal.setTime(dat);
today = df.format(dat);
Label2.setText(today);
repaint();
}
public static void main(String args[])
{
(new ToolbarFrame()).setVisible(true);
}
String dialogText[] = {
"--" + System.getProperty("com.symbian.appName") + "--", "Version 1.1, 31st January 2000"
};
public String appName;
public Label Label1;
public Label Label2;
public Button Button1;
public Button Button2;
public Button Button3;
public Button Button4;
public Panel panel;
private static int f1;
final int TOOLBAR_HEIGHT;
final int TOOLBAR_WIDTH;
final int BUTTON_HEIGHT;
final int TITLE_BAR_HEIGHT;
final int CLOCK_BAR_HEIGHT;
static int RIGHT_SHIFT;
public Menu viewMenu;
public MenuItem showToolbarItem;
public CheckboxMenuItem leftToolbarItem;
private boolean f2;
Thread timer;
Date dummy;
GregorianCalendar cal;
SimpleDateFormat df;
String lastdate;
Date dat;
String today;
private class _cls1 extends MouseAdapter
{
public void mousePressed(MouseEvent mouseevent)
{
TaskSwitch.displayTaskList();
}
_cls1()
{
}
}
private class _cls2 extends ComponentAdapter
{
public void componentResized(ComponentEvent componentevent)
{
f1.validate();
}
private final ToolbarFrame f1;
_cls2()
{
f1 = ToolbarFrame.this;
}
}
private class _cls3 extends Thread
{
public void run()
{
while(f1.timer != null)
{
try
{
Thread.sleep(100L);
}
catch(InterruptedException _ex) { }
f1.displayTime();
}
}
private final ToolbarFrame f1;
_cls3()
{
f1 = ToolbarFrame.this;
}
}
}
I've no idea if this will run and it still has one error - missing TaskSwitch - but I'm assuming that is in the jar you have decompiled and so will be resolve on your system.
Re: How do I compile this jar file
Success!! I am now able to compile a working jar file.
Thanks for all your help keang - much appreciated.
Final compilable source code attached.
Re: How do I compile this jar file
Excellent news, glad I could help.