EASY Java Question
I want to know how to make it so that when some one opens my site the browser window opens to a certain size that i designated
Thanx
well i would just use javascript
<html>
<head>
<script language ="javascript">
window.resizeTo(200,200);//change the number to change your screen size
</script>
</head>
<body>
</body>
</html>
hope this helps
Similar Messages
-
I just started using easy java simulations and keep coming across annoying little problems that I have to figure out myself because the documentation is not very good. Does anyone know of a appropriate forum where i can ask these questions?
What I'm trying to figure out right now is why it doesn't seem to recognize strings in if statements. I can print out the string and see that it have the correct value, but if i try:
if (stringVariable == "stringValue")
it never seems to evaluate as true.
Any ideas? Am I missing something?This is probably the number 1 newbie mistake.
== compares object references (in the case where the 2 operands are Object types, which String is). That does not compare contents of the object, just whether the 2 references refer to the same object in memory.
There is an equals method. Use it.
if (stringVariable.equals("stringValue")) ... -
Havent a clue! Please help! Easy ABAP Question!
Helly Gurus
I am loading from a dso to a cube and doing a lookup on a second dso.
eg
'Name' is in the DSO1
I lookup 'Address' from DSO2
Then load to the cube.
The problem is there may be more than one address so although I have coded the lookup to
find all addresses, I do know how to get these into my results.
Only the first address it finds is there.
loop at DATA_PACKAGE.
select * from DSO1 where
NAME = DATA_PACKAGE-NAME.
if sy-subrc = 0.
move-corresponding DSO2 to itab1. collect itab1.
endif.
endselect.
endloop.
What do I need to do to get all of the results?
I am in 3.5 so do not have the use of an End Routine.
Thanks
Tom Tomyou need to do several treatments in fact you need to add records on the data_package (by the way it is not an easy ABAP question as you mentioned !)
So
Treatment 1: select all the records from ods2 table of adresses outside the loop
select names adresses
from ods2
into table g_itab_ods2
for all entries in data_package
where name eq data_package-name.
Treatment 2: delete double records of the internal table.
delete adjacent duplicates from g_itab_ods2 comparing names adresses.
Treatment 3: loop over the data_package. Within this loop read the internal ods2 table and loop over it to assign the corresponding adresses. Then append the results to the temporary data_package_tmp and move all the records to the initial data_package.
loop at data_package assigning <data_fields>.
read table g_itab_ods2 into l_g_itab_ods2
with key name = <data_fields>-name.
if sy-subrc eq 0.
loop at g_itab_ods2 assigning <adresses>
where name = <data_fields>-name.
<data_fields>-adresses= <adresses>-adresses.
append <data_fields> to lt_data_package_tmp.
endloop.
endif.
endloop.
data_package[] = lt_data_package_tmp[].
free lt_data_package_tmp.
this should do what you want to do. hope this could help you out. -
Java Question... please help
I am running Snow Leopard (mac os x version 10.6.8)
For the past couple of years I've played gin in yahoo games.
Yesterday when I entered the gin lobby ...the font was so tiny
I wasn't able to read it. I checked Java on my computer and
it is enabled, however I just realized when I go into the gin
lobby... there is no java icon on the dock. Since the font size
is fine in all other applications, I am presuming this is a Java
issue.
Help if you are able.. please and thanksHuh? Is this a Java question? Where's the Java? I just see a little JavaScript. Do you know how to use servlets and JSPs?
Jesper -
What kind of Java questions can I ask?
Here's a change:
I want to interview some good java people. I have lots of Java questions in mind which I could ask them, however fellow JavaGuru's
I would like some potential questions from you which I could ask someone who claims he/she is a good java programmer??
I am asking because I want to be as fair as possible to the applicant and not ask them questions which I think are tough etc...Touchy subject.
The language is not as important, as understanding programming concepts.
So fine, when the programmer's horizont involves some abstraction levels.
If a programmer can write an UML class diagram for a linked list.
If a programmer knows a design pattern Singleton.
If a programmer can write his/her own single linked list class with sorted insertion.
Language concepts:
- Why:
import java.util.*;
Map map = new HashMap();
- Answer:
Hiding the choice of implementation (HashMap) by using the more general
interface Map.
Don't expect much on an interview though. The situation might not be
adequate to distinghuish between the good and the bad apples.
Talking code is a good starting point, code of your making unfortunately.
A good programmer will hesitate to show really useful code.
A bad programmer might have stolen his/her code.
The problem you might have, that you are in search of an expert, not
having the expertise in-house. In that case you might get a better
picture, talking about which IDE would be opportune, whether he/she
has experience with the source version system CVS, what would his/her
ideas be about coming projects.
That would establish a common line of communication. -
Interesting Java Questions. Need answers Pls
Hi All,
I have come accross few java question, could any one please provide best answers please?
1. Why the wait() method is there in the Object class? Not in the Threads?
2. Why JDBC has all interfaces & not classes?
3. Which type of collection do u prefer to make the incoming objects in sort order?
4. Why the hasCode() method should be implemented if we are overiding the equals(0 method?
Please provide me best answers ASAP.
Girish.Kdo u prefer tohttp://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes. -
Easy swing question for Java friends
Hi could somebody test this short application and tell me why the "DRAW LINE" button doesnt draw a line as I expected?
thank you very much!
Circuitos.java:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.awt.geom.*;
public class Circuitos extends JApplet {
protected JButton btnRect;
protected Terreno terreno;
private boolean inAnApplet = true;
//Hack to avoid ugly message about system event access check.
public Circuitos() {
this(true);
public Circuitos(boolean inAnApplet) {
this.inAnApplet = inAnApplet;
if (inAnApplet) {
getRootPane().putClientProperty("defeatSystemEventQueueCheck",Boolean.TRUE);
public void init() {
setContentPane(makeContentPane());
public Container makeContentPane() {
btnRect = new JButton("DRAW LINE");
btnRect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
terreno.pintarTramo();
terreno = new Terreno();
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add("North",btnRect);
panel.add("Center",terreno);
return panel;
public static void main(String[] args) {
JFrame frame = new JFrame("Dise�o de Circuitos");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
Circuitos applet = new Circuitos(false);
frame.setContentPane(applet.makeContentPane());
frame.pack();
frame.setVisible(true);
}Terreno.java:
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class Terreno extends JPanel {
Graphics2D g2;
public Terreno() {
setBackground(Color.red);
setPreferredSize(new Dimension(500,500));
public void paintComponent(Graphics g) {
super.paintComponent(g);
g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
public void pintarTramo () {
Point2D.Double start = new Point2D.Double(250,250);
Point2D.Double end = new Point2D.Double(250,285);
g2.draw(new Line2D.Double(start,end));
}I don't think the date I became a member has anything to do with it. Yes, I signed up a year ago to ask a question or two when I didn't know anything. It wasn't until recently have I started to use this forum again, only to try and help people as well as ask my questions. It took me a year to get to this point to where I can actually answer questions instead of just asking. So don't be silly and judge a person based on their profile.
Secondly, I agree with you, the search utility is great. I use it all the time and usually I'll find my answers, but if I don't is it such a pain in the butt for you to see the same problem posted again?? I know how much you want people to use the resources available before wasting forum space with duplicate questions, but it's not going to happen. Some people are not as patient and you being a butt about it won't stop it.
My point in general is that there are nice ways to help people and even rude ways, and your comments at times come across rude to me, even condescending. You have a lot of knowledge, therefore certain things seem trivial to you... but try to understand where some of the new people are coming from. The Swing tutorial is extremely helpful but if you don't understand the concept of programming or java that well... then it can be overwhelming and you don't know where to start. It's a huge tutorial and when people are stuck they just want an answer to their one question. Most figure it's easier to ask someone who already knows instead of reading an entire tutorial to get their answer.
I've learned by both methods, by taking the time to research it myself and by asking a lot of questions. I have the time. Some don't. Please realize that not everyone is like you and they will continue to ask whether you like it or not. You have a choice, either help them or not. -
Easy Java GUI Question Please Help!
Please help! whenever I try to run this code:
package here;
import java.awt.Graphics;
import java.awt.Color;
mport javax.swing.JFrame;
public class Window extends JFrame {
public Window(){
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
setSize(500,500);
public void paint(Graphics g){
g.drawString("Hello!", 75, 75);
public static void main(String[] args) {
new Window();
this keeps happening http://www.youtube.com/watch?v=k7htCX6a4BI&feature=watch_response
(I didn't post this video but it looks like I'm not the only one this has happened to)
its like I get a weird screen capture :/
I tried setting the bacgkround color and I tried using netbeans instead of eclipse. neither worked.
Any help would be really great! I don't want to get discouraged from learning java!First of all it contains Syntax error .
Call the super paint method when trying to override the paint method .
package here;
import java.awt.Graphics;
import java.awt.Color;
import javax.swing.JFrame;
public class Window extends JFrame {
public Window(){
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
setSize(500,500);
public void paint(Graphics g){
// call the base paint method first
super.paint(g);
g.drawString("Hello!", 75, 75);
public static void main(String[] args) {
new Window();
Edited by: VID on Mar 31, 2012 5:05 AM -
Java amateur...easy error question
I am trying to use some methods from my other classes and I am getting a compile error that it does not recognize these methods. I have import the classes what else could be wrong?
A:\spell.java:52: cannot resolve symbol
symbol : method searchOrderedList (java.lang.String)
location: class spell
if(!searchOrderedList(lineCheck));//compares String to Strings in hash table
^
A:\spell.java:53: cannot resolve symbol
symbol : method insertTree (java.lang.String)
location: class spell
insertTree(lineCheck);
^
A:\spell.java:88: cannot resolve symbol
symbol : method insertHash (java.lang.String)
location: class java.lang.String
line.insertHash(line);//stores String in hash table
^
3 errors
Tool completed with exit code 1The methods may be from some other class, but your code doesn't say that. Here's an example:
insertTree(lineCheck);This line of code tries to call the insertTree method of this class, not of some other class. -
Kay
Say for example i had:
public int[] i d= new int[3];
{code}And i[0] was set to 3, i[1] was set to 5, i[2] was set to 4, and i[3] was set to 1.
Basically in easier terms:
{code:java}
i[0] = 3;
i[1] = 5;
i[2] = 4;
i[3] = 1;
{code}Right, how would i make an alternative int like this:
{code:java}
int highestNumber = (*);
{code}Basically i want (*) to select the biggest integer out of the i[] int. So in that case i would want it to automatically select i[1] as it has the largest amount, that's what i need help with.
*ALSO*
How could i reset all of those int's to 0 in one easy code?
Thanks.Ryan_Stanyer wrote:
Can you tell me why that wouldn't work? Or what alternative method i can use to make something with the same function?You create an array of 3 elements but try to put 4 elements there.
And also.
Ryan_Stanyer wrote:
int highestNumber = (*);
{code}Basically i want (*) to select the biggest integer out of the i[] int. So in that case i would want it to automatically select i[1] as it has the largest amount, that's what i need help with.create a method
int getMaximalItem(int []array) [
//implementation goes here
Ryan_Stanyer wrote:ALSO
How could i reset all of those int's to 0 in one easy code?
Thanks.Create a method like:
public void setToZeros(int []array) {
// implementation goes here
}Put some effort into this task and then ask specific questions if somethings are still not working.
Regards, -
So I bind a variable in an ActionScript and store a value at
compile time. Now I want to update that var at runtime, say
calculate a meal.I had the following Java versions listed on one computer and one of them would not uninstall, so I am wondering how much of a problem that might be for the end user.
Java 2 Runtime Environment, SE v1.4.2_03
Java(TM) 6 Update 3
J2SE Runtime Environment 5.0 Update 6
Java 2 Runtime Environment Standard Edition v1.3.1_15 (this one is "stuck" within "Add/Remove Programs" listing)
After removing all of the above Programs and rebooting the computer I installed "jre-6u7-windows-i586-p.exe" which translates as "Java(TM) 6 Update 7" (137.00 MB) for us simple humans to read.
Suggestions:
It would be great if the naming conventions of these programs made a little more sense or if the Downloads area of the Java web site had a Frequently Asked Question (FAQ) prominently featured at the top of the page explaining the history of these versions. I have been supporting the installation of these Plug-ins or Programs for several years and feel it has not gotten any easier with regards to names.
It might even be nice to see a Timeline of versions showing:
Java(TM) 6 Update 3, Released January 2008
Java(TM) 6 Update 7, Released October 2008
This would allow people using specific pieces of older software, as mentioned above, to have some idea of whether the version of Java they find on their machine is the appropriate version for some in-house application that was written and released in December 2007 (for example).
If a web-based office application I use was written in February of 2008 then I might feel confident "Java(TM) 6 Update 3" is the right version for me!
If this is confusing for me as an I.T. support professional, I can only imagine how the End Users view these cryptic file names!
~
Edited by: Klaatu01 on Mar 9, 2009 9:49 AM
Edited by: Klaatu01 on Mar 9, 2009 9:53 AM -
Ideas needed for easy java runtime roll-outs
On the cusp of Sun's newfound enthusiasm for Java everywhere I felt I had to post a few questions on the state of the runtime installers. We've been having awful problems getting the runtime installed on clients; Windows XP boxes are a particular problem as users have a very restricted set of privileges and write access - meaning that the runtime installation has to be run by someone with Administrator rights. This just isn't practical when we're trying to roll out a Java Web Start solution enterprise-wide.
In an ideal world I suppose the runtime would be delivered pre-installed and big pat on back for getting Dell & HP to agree to this; but even with their support they'res still going to be a lot of Java unfriendly PC's out there.. Anybody got any clever ideas on routes around these problems.. I've tried to document some of our frustrations in the first part of this document
http://lopica.sourceforge.net/services/ . During the process of writing the same I stumbled across Microsoft's Windows Installer Service WhitePaper which states:
Operation in Lockdown Environments
To decrease support costs, many
organizations have locked down their
desktops by controlling people's ability to
write to the file system and registry. While
this prevents a person from accidentally or
intentionally modifying their configuration,
it also requires administrator intervention
whenever a new application needs to be
installed. Since the Windows Installer
operates as a system service on Windows NT
4.0 and Windows 2000, it has the ability to
run in one of two contexts:
- As the Local System account, which
has greater privileges than the user
- As the user, which is the default behavior
In a Windows 2000 environment, using the
Group Policy-based Change and Configuration
Management, the administrator can approve
certain applications, specifying that all
configuration operations on those
applications (installation, uninstall, and
repair) run as the Local System account. In
this manner, administrators can lock down
the file system and registry as described
above, and the Windows Installer service can
still perform installations on the person's
behalf. Only those applications approved by
the administrator run with elevated
privileges.
I've also run across "Provide .MSI file for Java, to deploy Java using active directory" (http://developer.java.sun.com/developer/bugParade/bugs/4854974.html). It appears Microsoft Installer might be the answer to both enterprise installation and the admin rights installation bugbear which really prevents us from offering users an easy install path. I'd be interested in hearing from anyone who has found any ways around these problems, are their any ms admins out their who've already repackaged the installers as msi packages and got the above deployments to work? Comments? Anyone?
..Finnaly (and can't resist a winge here) I find Sun's renewed interest in Java on the Desktop all very laudable; but the runtime support for Java Web Start and the Window ActiveX AutoDownloader are completely out-of-step. Web Start users still can't access
1.4.1_01, 1.4.1_02 or 1.4.1_03 runtimes from Sun's servers (as per the jnlp specs) (http://developer.java.sun.com/developer/bugParade/bugs/4827788.html) and support for other versions is very limited and always painfully slow coming online (http://developer.java.sun.com/developer/bugParade/bugs/4836169.html) (http://forum.java.sun.com/thread.jsp?forum=38&thread=366655).
I understand these are special installers and require extra development alongside the better known .exe versions (which have they're own chequered history with XP & InstallShield issues). But come-on Sun, a little more forethought and support - please..
- RichardDoes your msi just unpack the files or will it attempt to make the registry changes / os bindings that java plugin & java web start need?
The way around the privs issues with msi's needs some security policy settings being made - I'm assuming these can be done by the domain administrator for all its users - but I'm out of my depth here; this is only a solution for organisations with enforced polices ~ but very important nevertheless.
Sun seem to have attempted this in the past, but they're seems to have been a regression since; the following bug report suggests some manual registry settings that might effect the required changes.
Bug ID 4431060 Installer quits when run as restricted user in windows 2000: http://developer.java.sun.com/developer/bugParade/bugs/4431060.html
But I couldn't get these to work with the (purloined) 1.4.2beta msi, nor the java update beta test (v5.5.5). What I'd really like to know is how to setup a group policy to achieve the same with an msi package that really works.. and have the details about how to setup an msi deployment domain-wide.. the whitepaper suggests both are possible with windows installer.
- Richard -
public static void main(String[] args)
..anyone know the statement as above could be start at begining , so what is the (String[ ] args) mean in java ?
in my ideas of this statement is
publc : indicates the statemean can be used as all class , this is open for public use
static mean the main method can used as class method
void indicate that the statement return nothing
main indicate any class should be run this first.
so my question what is the function of (String [ ] args) ? // one string array call args ?String[] args is indeed an array of Strings called args. The reason it's there is to collect any arguments passed to your code when you start it.
eg. if you have a class called TestClass and you called it from the command line like this:
java TestClass exam tomorrow oh shite
.......then the args array would hold the four Strings:
exam
tomorrow
oh
shite -
Can't edit multiple tracks - plus 2 easy audio questions
I have a sequence with 1 video track and 6 stereo audio tracks. I set an in and an out point. The area on the clips in the timeline between the two edit points highlights, I hit delete. Normally, the tracks between the points should disappear as the two segments come together and form one great edit.
But all the tracks do not highlight and edit. The video track and stereo audio tracks 3+4 and 5+6 highlight and LIFT off. But audio tracks 1+2 do not highlight or edit. And the whole sequence doesn't close together where the edit should be.
Only way I have been able to overcome this is to use the razor blade tool, cut each track individually. Highlight them all, and then hit delete.
This didn't use to be the way. FCP used to edit through one track, 3 tracks or all tracks, no problem.
Two audio questions. How do you stop the waveforms from drawing onto the clips in the timeline, in order to speed up FCP?
How do you get the audio in captured clips to be a Stereo Pair, from the outset?
Thanks to all you who help!Is it usual for FCP to bog down on a 4 minute piece when audio wave forms are turned on??
<
No. Should run fine. You get up into 6-12 audio tracks, FCP gets all moody and pouty.
But it depends on your system's capabilities and how well you have chosen your sequence settings.
Audio waveforms n FCP are a cruel joke compared to many other NLEs. Often easier to leave them off in the timeline, use the waveform in the Viewer and set markers for hooks in the audio tracks.
bogiesan -
By using the JDBC form wizard, I generated a swing program. Along with the java code, there is a form file which looks like an xml file. My question is how to complie and run the java source code without a forte4j IDE?
ThanksOne thing is you need the jdbc in your classpath or specify at runtime. Search compiler in the forte help menu - to see options.
execution : <specify at runtime>
java -classpath:.;postgresql.org Program
-- above for postgresql driver residing in same directory as Program.class
compile : javac Progam.java or javac -classpath .;postgresql.org Progam.java
Ray
Maybe you are looking for
-
ITunes will not install because my Computer is missing a file QuickTime.msi
Hello, I have uninstalled all my apple files except those for QuickTime because it needs QuickTime.msi. Installing iTunes fails for the same reason. I have searched all of my C Drive and it does not exist. My laptop was originally running Vista and p
-
Extract Category, Attributes data in Multilingual
Hi experts, I'm using the MDMGX to extract the Categories data using the F/M "MDM_COMM_CATEGORIES_EXTR". data is populated (in debug mode) in all languages but, when the XML file created its showing only English language data. did I left any configur
-
Trace SQL statement issued by BC4J
Is there a way to see at runtime (in the console window or in a log file) the SQL statements issued by the BC4Js to the database? Perhaps there is a switch or a -D option to set to the OC4J startup command. This would be really helpfull during develo
-
Error in check_tableview_all_rows ?
I've seen postings on the same subject before, but here we go again: In a page with 2 or more tableviews, the following code: cl_htmlb_manager=>check_tableview_all_rows( rowcount = wa_lines request = request
-
Cannot hear audio from internet video. Can hear DVD. Help!
Cannot hear audio from internet video. Can hear DVD. I don't know what I changed in msconfig start up.