How to get the size of the test put in a JPasswordField ?
I've checked all the methods that may allow me to know the size
of the text in a JPasswordField.
I tested getCaretPosition() , getSelectedEnd()
and they don't satisfy me : they give the current position of the cursor
and not the size of the text typed. The only safe method is the use
of the method getText() which is deprecated, so that i can get the
size of the resulting String.
Is there a method that allow to know the size of a char arrays ?
Any help will be welcome, thanks.
JPasswordFieldObj.getPassword().length;the length variable isn't visible in the forte visual parameters.
thanks a lot, it saved me a lot of time and let me keep the
getPassword() secure.
Sorry, don't have more duke dollars, but you should have get some for this.
Similar Messages
-
How to get the current Mailbox size
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?Originally Posted by NanLau
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?
Can anyone answer this? Thanks. -
How to get the file size (in bytes) for all files in a directory?
How to get the file size (in bytes) for all files in a directory?
The following code does not work. isFile() does NOT recognize files as files but only as directories. Why?
Furthermore the size is not retrieved correctly.
How do I have to code it otherwise? Is there a way of not converting f-to-string-to-File again but iterate over all file objects instead?
Thank you
Peter
java.io.File f = new java.io.File("D:/todo/");
files = f.list();
for (int i = 0; i < files.length; i++) {
System.out.println("fn=" + files);
if (new File(files[i]).isFile())
System.out.println("file[" + i + "]=" + files[i] + " size=" + (new File(files[i])).length() ); }pstein wrote:
...The following code does not work. Work?! It does not even compile! Please consider posting code in the form of an SSCCE in future.
Here is an SSCCE.
import java.io.File;
class ListFiles {
public static void main(String[] args) {
java.io.File f = new java.io.File("/media/disk");
// provides only the file names, not the path/name!
//String[] files = f.list();
File[] files = f.listFiles();
for (int i = 0; i < files.length; i++) {
System.out.println("fn=" + files);
if (files[i].isFile()) {
System.out.println(
"file[" +
i +
"]=" +
files[i] +
" size=" +
(files[i]).length() );
}Edit 1:
Also, in future, when posting code, code snippets, HTML/XML or input/output, please use the code tags to retain the indentation and formatting. To do that, select the code and click the CODE button seen on the Plain Text tab of the message posting form. It took me longer to clean up that code and turn it into an SSCCE, than it took to +solve the problem.+
Edited by: AndrewThompson64 on Jul 21, 2009 8:47 AM -
How to get the Frame size in H.263 by JMF ?
Dear all,
How to get the individual frame size in H.263 format if the H.263 file is a format of InputStream ???VideoFormat.getSize() returns a Dimension of a frame. H263Format is a subclass of VideoFormat. Guess you could get that object from getFormat() in your stream if it's a PullBufferStream. Or, with a Processor, you could do getTrackControls() and iterate through the TrackControl.getFormat()s until you find the VideoFormat.
Suppose you could also get a FrameGrabbingControl, grab a frame and get the Dimension from him.
--invalidname -
How to get the size of driver[C: or D:]
Hi Friends,
I have a query regarding to java..
I want to get the name of all the drives that r connected to the System including network drives...
and how to get the size of any system drive[For example C: or D: Drive].
I want the output to be displayed like in the following format
Device type size free Usage_Space
for ex.
C: NTFS 37.5Gb 30.5gb 7gb
Output like as linux command df -h
Edited by: KituPrash on Mar 4, 2009 3:29 AMDoes this help for starters?
File[] roots= File.listRoots();
for (int i= 0; i< roots.length; i++)
System.out.println(roots[i]+": "+roots.getTotalSpace());kind regards,
Jos -
How to get the size of physical memory by using system call ?
how to get the size of physical memory by using system call ?What system call can be used for me to get the size of physical memor? thanks.
%vmstat 3
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 -- -- -- in sy cs us sy id
0 0 0 3025816 994456 4 19 6 0 0 0 0 8 0 0 0 459 253 139 1 1 99
0 0 0 2864688 777408 0 2 0 0 0 0 0 3 0 0 0 428 134 175 0 1 99
0 0 0 2864688 777408 0 0 0 0 0 0 0 7 0 0 0 448 112 166 0 0 100
one interesting observation about vmstat I found out is (mostly on Solaris)
the first line of information always off chart, so I usually do a few interval to get constant result.
if you use linux
just
cat /proc/meminfo -
How to get the size of partition?
The following SQL will get the rows of the fact table & aggregation. But how to get the size (MB) of the partition. select * from $system.discover_partition_stat That should be doable, because in BIDS, we can see the size of a partition, but from which
view we can do that?This is the best bet you have SELECT * FROM SystemRestrictSchema($system.discover_partition_stat ,DATABASE_NAME = 'Adventure Works DW' ,CUBE_NAME = 'Adventure Works' ,MEASURE_GROUP_NAME = 'Internet Sales' ,PARTITION_NAME = 'Internet_Sales_2003') Refer
this article: http://geekswithblogs.net/darrengosbell/archive/2008/12/02/ssas-are-my-aggregations-processed.aspxvinu -
How to get the size of the webpage?
I am designing a program to
analyse the webpage content.
wondering how to get the size of
the webpage including its image's
size and etc. Thanks in advance.As i know , the getContentLength just return
then number of characters of its HTML code.
By knowing the length of the HTML code, is
not possible for me to calculate its download
time... i wonder is there any way to get the
total size of the page including its image size,
applet size, and etc... Thanks : ) -
How to get the size of a hard disk?
Hi,
As above, how to get the size of a hard disk by using Java.
Thanks you!
AlexI would be interested in the answer of this question, too.
In core Java there is no way to find it out in a platform independent manner because of the hardware abstraction of the VM. So my only idea is to write a native library for doing this and colling it via JNI -
How to get the size of the table
Hi All,
How to get the size of the table in Oracle 10g?
Is there any script which needs to be run?
Regards,
ApoorvHi All,
Sorry but somehow the table user_segments is not populated in my case. But we have another table SYS.ALL_TABLES whose structure is given below. Would I be able to calculate the table size based on the columns given below:
ColumnName Data Type
OWNER VARCHAR2 (30 Byte)
TABLE_NAME VARCHAR2 (30 Byte)
TABLESPACE_NAME VARCHAR2 (30 Byte)
CLUSTER_NAME VARCHAR2 (30 Byte)
IOT_NAME VARCHAR2 (30 Byte)
STATUS VARCHAR2 (8 Byte)
PCT_FREE NUMBER
PCT_USED NUMBER
INI_TRANS NUMBER
MAX_TRANS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
LOGGING VARCHAR2 (3 Byte)
BACKED_UP VARCHAR2 (1 Byte)
NUM_ROWS NUMBER
BLOCKS NUMBER
EMPTY_BLOCKS NUMBER
AVG_SPACE NUMBER
CHAIN_CNT NUMBER
AVG_ROW_LEN NUMBER
AVG_SPACE_FREELIST_BLOCKS NUMBER
NUM_FREELIST_BLOCKS NUMBER
DEGREE VARCHAR2 (10 Byte)
INSTANCES VARCHAR2 (10 Byte)
CACHE VARCHAR2 (5 Byte)
TABLE_LOCK VARCHAR2 (8 Byte)
SAMPLE_SIZE NUMBER
LAST_ANALYZED DATE
PARTITIONED VARCHAR2 (3 Byte)
IOT_TYPE VARCHAR2 (12 Byte)
TEMPORARY VARCHAR2 (1 Byte)
SECONDARY VARCHAR2 (1 Byte)
NESTED VARCHAR2 (3 Byte)
BUFFER_POOL VARCHAR2 (7 Byte)
ROW_MOVEMENT VARCHAR2 (8 Byte)
GLOBAL_STATS VARCHAR2 (3 Byte)
USER_STATS VARCHAR2 (3 Byte)
DURATION VARCHAR2 (15 Byte)
SKIP_CORRUPT VARCHAR2 (8 Byte)
MONITORING VARCHAR2 (3 Byte)
CLUSTER_OWNER VARCHAR2 (30 Byte)
DEPENDENCIES VARCHAR2 (8 Byte)
COMPRESSION VARCHAR2 (8 Byte)
DROPPED VARCHAR2 (3 Byte) -
Hi
I want to know the size of the file from Java. ie If i have 10 lines in that file each of 15 characters
then 10 *2*10=200Bytes is the size. How will i get this?
More over, if i am reading the 4 the line, how will get the info that I have read 3 lines =3*2*10= 60 bytes so far?
Regards
SriramThis is from the JavaDocs on java.io.File
length
public long length()
Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.
Returns:
The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist
Any of the read methods (except readLine()) on the many stream objects return the number of bytes read, simply accumulate these returns to know how many bytes have been read.
Dave -
Hi, everyone, does anyone know how to get the size of the disk, say hard disk? In the Writing Device Driver it says that the block device driver must create an 'nblocks' property for each minor block device. I want to get the size of the block device in another driver. Is there any DDI/DKI kernel function for this?
How to get the same thing in a user mode application? Is there any API to do this?
Thank you very much.I just found a function in include/sys/conf.h. The prototype is:
extern int bdev_size(dev_t);
Can I use this function to get the disk size of the device dev_t? I couldn't find the documentation of this function.
Thanks -
How to get the correct size of the loaded swf file?
final public class main extends Sprite
public function main()
loaderInfo.addEventListener(Event.COMPLETE, _onLoadCompleted);
private function _onLoadCompleted(event: Event): void
var tw: int = stage.width;
var th: int = stage.height;
var tsw: int = stage.stageWidth;
var tsh: int = stage.stageHeight;
Above is my simple as3 project in flex builder 3.
My screen resolution is 1920*1080, when debugging, the swf is stretched to the full client area of the IE, but the stage.stageWidth is 500 and the stage.stageHeight is 375, both the stage.widht and stage.height are 0, who can tell me why and how to get the right size of the swf file, named the client area size of the IE in this situation?
Thanks very much!The HTML wrapper might resize the SWF later, so wait a frame and check stageWidth/stageHeight again.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
How to get the personal folder size
Hi,
I'm trying to develop a method for define the maximum size of personal documents folder. I'm changing the Upload Command, and I want to know if its possible to get the current size of the personal documents folder for the user that is trying to upload the document.
For this moment, I've got the current UserID, and I have created an RID with the path "userhome/UserID/Personal Documents", but now I don't know how to get the size of this folder!!!!
Thanks to all.
Arnau RoviraOriginally Posted by NanLau
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?
Can anyone answer this? Thanks. -
How to get the byte[] size dynamically from the StreamMessage object
Hi all,
Using JMS, I am receiving the FDF file as StreamMessage from the queue and attaching it to the PDF file which is present in the local system.
For that, I have written the code as follows:
{color:#0000ff} Message msg = jmsTemplate.receive();
if(msg !=null && msg instanceof StreamMessage)
StreamMessage message = (StreamMessage) msg;{color}
{color:#ff6600}//hardcoded the byte array size value
{color}{color:#0000ff} byte[] bytes = new byte[{color:#ff0000}856{color}];
System.out.println("read msg="+message.readBytes(bytes));{color}
{color:#0000ff}PdfReader pdfreader = new PdfReader("D:\\Managing_Workflows_No_Comment.pdf");
PdfStamper stamp = new PdfStamper(pdfreader, new FileOutputStream("D:\\12345.pdf"));
FdfReader fdfreader = new FdfReader(bytes);
stamp.addComments(fdfreader);
{color} {color:#0000ff} stamp.close();
{color}{color:#000000}The above code is working fine except with the hardcoded of {color:#ff0000}byte array{color}{color:#ff0000} size value{color} which is given in {color:#ff0000}RED{color} in color.
Can anybody know, {color:#000000}*how to get the byte[] size dynamically from the StreamMessage*{color} object ?
Any help would be highly beneficial for me !!!!
Thanks and Regards,
Ganesh Kumar{color}When you create your stream message you could add an property to your message, something like streamSize that would contain the number of bytes in your stream message. Then you could get this property from the message before declaring your array.
Tom
Maybe you are looking for
-
Hi to all my I pad 3 will not be recognized by my pc I have temporarily disabled my anti virus , and re booted both & made sure all drivers are up to date . I have made sure iTunes is the latest version & changed USB ports ...... Man I'm getting frus
-
Any limit for burn itunes purchased songs into a cd?
I wanna ask is there any limit to burn purchased songs into a cd? If yes, what is the max? Thx
-
Server 2012 R2 - Remote Apps (RDWeb) and Self Signed Certificates!
Hi all! I have been playing around with VM's on Microsoft Azure just to try and have some Windows Services facing externally that I can play around with and test. I have spun up a Windows Server 2012 R2 Server and installed Remote Desktop Services on
-
I am a total newbie of Flash (and web design). I have tis problem:- 1. I created a Flash file (a banner with text and graphic) and imported to Dreamweaver. I can view it when I click the play button on property inspector. However, it appears blank wh
-
How do I cancel a monthly subscription to a magazine
I am trying to cancel a subscription to a magazine and I don't know how to do this