Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Increase console size?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
awakening_64




PostPosted: Fri Mar 07, 2008 10:16 pm   Post subject: Increase console size?

how do i increase the size of the output console in java applications? (i only need the syntax)

aswell as the syntax for a random number between 1 and 52. i think it's Math.rand after that im not sure.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Mar 07, 2008 11:21 pm   Post subject: RE:Increase console size?

In general terms you can't effect the console's size, draw in it or change font/color/size of text. There are some OS spefick hacks to get around it but it realy goeses agisted the point of a console. If you wont to change the size of the application you are making on the screen you should probly not be using the console.

As for the random question:

Math.random() will give you a pesdo random number from 0.0 to 1.0. To make this between 52 and 1 you could times the random number by 51 and then add 1. This will work becues if you get the high case of 1.0 it is 1.0 * 51 + 1 = 52.0 and in the low case you get 0.0 * 51 + 1 = 1.0

Rember that the value is a double and not an int.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
awakening_64




PostPosted: Sun Mar 09, 2008 12:43 am   Post subject: Re: Increase console size?

thank you for your help.
ahmhum




PostPosted: Mon Mar 10, 2008 9:46 pm   Post subject: RE:Increase console size?

you actually can make the console size big or small

this is how

c=new Console(20,90);
(change the numbers according to you the 20 is the vertical value and the 90 is the horizontal value.)

and if you want to move the location of the console

c.setLocation(160,40);
(160 is to move left or right, and 40 is to move it up and down)

but you have to declare the console in the class

static Console c;
Saad




PostPosted: Mon Mar 10, 2008 9:49 pm   Post subject: RE:Increase console size?

If I am not mistaken, the Console class that ahmhum just said is strictly a ready to program java library?
Dan




PostPosted: Mon Mar 10, 2008 11:54 pm   Post subject: Re: RE:Increase console size?

Saad @ 10th March 2008, 9:49 pm wrote:
If I am not mistaken, the Console class that ahmhum just said is strictly a ready to program java library?


Yep, it is not standard java and it is also not a real console. This is why peoleop need to say if they are using RTP or aucatly using java Confused


Edit: Also it would be nice if teachers stop teaching that the RTP library's are Java. It gets kids realy mixed up and would make it hard for them to code in a normal install of java. I have hured many times from some teachers that they just use RTP for the IDE, however it is pirty clear that alot of students are using more then just that from RTP and geting a twisted view of java programming.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
ahmhum




PostPosted: Thu Mar 13, 2008 6:36 pm   Post subject: RE:Increase console size?

what exactly do u mean by standard java
ahmhum




PostPosted: Thu Mar 13, 2008 6:37 pm   Post subject: RE:Increase console size?

all i have is IBM VisualAge For Java
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: