The ScrollPane doesn't work, and the TextArea just keep getting bigger!
Here is what I did: I made a Frame first. Then I made a TextArea. Then I made a Scroll. Then I made a panel.
Then I add the TextArea and the Scroll to the Panel, and I add the Panel to the Frame, but the whole thing just doesn't work. Anyway, see for it yourself.
Hope someone can find where I did wrong, thank you very much!
import javax.swing.*;
public class TextArea extends JFrame
public static void main(String[] args)
new TextArea();
public TextArea()
/*Frame*/
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
/*TextArea*/
JTextArea text = new JTextArea(10, 50);
text.setLineWrap(true);
text.setWrapStyleWord(true);
text.setEditable(true);
/*Scroll*/
JScrollPane Scroll1 = new JScrollPane(text, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
/*Panel*/
JPanel panel = new JPanel();
/*Add things together*/
panel.add(text);
panel.add(Scroll1);
this.add(panel);
this.pack();
this.setVisible(true);
}
after you make this change, the reasons for your problem
should become clear
/*Add things together*/
//panel.add(text);//<-------------remove line
panel.add(Scroll1);
Similar Messages
-
i have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything
Will u help me or not?
-
How to I set an internal link in a PDF document using Preview? After setting a link under the Tools/Annotations menu, the link doesn't work and no detailed instructions are provided via the Help menu other than it showing the pull-down menu selection to make.
No. I am able to use the other features such as underlining, highlighting, adding rectangles and oval and save those changes.
-
I just upgraded the software on my iPhone 4s. Now the touchscreen doesn't work and on the screen is the itunes logo, an arrow and a plug. I have powered it off and on and nothing changes
The iTunes icon and cable means that it's gone into recovery mode - you will need to connect the phone to your computer's iTunes and you should be able to use that to reset the phone, and you can then restore/resync your content to it
-
I have a virgin moble iphone that i found, the power button doesn't work and the phone is saying disabled,what can i do to fix it?
Probably nothing, the phone has a high likelihood of being stolen and if you try to Restore it you will run into Activation Lock. Turn it in to the local authorities.
-
i can`t use apple store. my apple id needs my paswoord, to set the security questions, after I introduce the paswoord it askes for the paswoord again and again! it doesn`t work, and the paswoord is the right one. What can i do?
I have figured out already. Firstly please try:
1) Installing iBooks on your iPhone via iTunes on PC/MAC
2) Adjust the time of your iPhone to 6 months ahead (e.g. 2013 May)
3) Close all apps currently running, clear Safari cache and history, sign out of Apple ID (Settings>iTunes & App Stores), reboot your device
4) Open iBooks on your iPhone, download any 1 book
5) System should prompt you to enter 3 security questions
6) Enter your answer and click "Done" at bottom right part of your input keyboard (Do not press upper right button)
7) Done!
I cannot imagine the system has gone so stupid. Apple, please retify the problem ASAP. -
In Safari, the link to "mail this web page" doesn't work, and the share link shows "no service". Does anyone have a solution? I have a MacBook Pro and upgraded to Yosemite yesterday.
See here: If sharing options and Markup are missing after you install OS X Yosemite
This resolved the issue for me.
Rick -
My MacBook Pro won't restart after updating iTunes, and so the update doesn't work. I have just purchased an iPad mini and can't sync it - can anyone help
Press and hold power button for up to 30 seconds. Remove battery and reinsert then repeat.
-
If your top bottom on the iPhone doesn't work and it's not insured can Apple do anything?
If your top bottom on the iPhone doesn't work and it's not insured can Apple do anything?
If you are talking about the sleep/wake button then the answer is yes. You will have to pay the out of warranty fee for replacement
$149+tax -
i want to create an external video widget with iAd to use in an iBook. I followed the steps and copied the Url and paste it in the Video pop-up menu in the Properties section of the inspector. When i select 'preview' the video doesn't play and the Url that i pasted is gone.
hope someone can help!May have something to do with whether or not the URL can be reached while building your widget. I've got a video on the web. When I enter the URL into the field for the video object and click to another field, the URL is replaced with some text indicating that it is accessing the video then updates itself to displaying just the name of the video file.
It shows just fine in preview and I can see the full path to the video when I export the widget so it should work for you.
Is the video accessible from your Mac while you're laying out your widget?
-Mark -
(OSX 10.5.8, PowerPC 1.25 GHz) Recently, the keyboard lighting stopped working and the preferences option has disappeared. What happened?
Reset the Power Management Unit (PMU): http://support.apple.com/kb/HT1431#faq10 . If that doesn't do it, reset PRAM: http://support.apple.com/kb/HT1379
-
my iphone 4 the vibrate has stopped working and the txt tone wont work even tho it says its got a tune and when i go to turn it up on side buttons it say (headfones) but they arent plugged in, but the sound works when someone rings me???
ATtempt to power off your device and power it back on, if that doesn't work reset all settings should resolve it for you
-
I cant scroll my iphone or the touchscreen is not working and the invert color is on i wanted to off it i cant scroll it down what will i do i need some help
Did you try recovery mode? iOS: Unable to update or restore
Or How to put iPod touch / iPhone into DFU mode -
I downloaded the newest version of Firefox. Now I just keep getting a message to restart my computer. I have restarted numerous times and keep getting same message. Any suggestions edit
Hi Dann, did you delete to the Recycle Bin, or did you do a more drastic permanent delete (e.g., Shift+Delete) or empty the Recycle Bin?
''If you think it might be in the Recycle Bin:''
First, make sure hidden folders are viewable. You can do that using Windows Explorer or My Computer > Tools > Folder Options > View tab. Look for the radio buttons to show or not to show hidden files and folders.
Now look for C:\Documents and Settings\''username''\Application Data\Mozilla\Firefox\Profiles or some part of that path, or your actual profile folder, which would have had a semi-random name, typically ending with default, or the bookmarkbackups folder, which is the ultimate prize.
''If it's not in the Recycle Bin:''
To recover your old Firefox settings folder (profile folder), try using a utility like Piriform's Recuva:
http://www.piriform.com/recuva
That needs to run ASAP before deleted files are overwritten.
The folder you're looking for would have had a semi-random name, but be located here:
C:\Documents and Settings\''username''\Application Data\Mozilla\Firefox\Profiles
By default, that folder is hidden. Make sure hidden folders are viewable. You can do that using Windows Explorer or My Computer > Tools > Folder Options > View tab. Look for the radio buttons to show or not to show hidden files and folders.
In particular, a bookmarkbackups folder would be a wonderful thing to be able to recover.
Hopefully one of these methods will work for you. -
Count(*) in the loop doesn't work and I really don't know why...
Hello,
I can't figure out why the following doesn't work. I cannot debug for I do not have privileges on this server.
The execution always fails on bolded line. If I substitute the variable with the table name itself it works. The variable is properly populated in each of the iterations as I can see it by using dbms_output package. The small but may be important detail may be I am connected as user A but the tables are in the schema B. However I can list the tables and their columns in all_tab_cols view and there are synonyms made in my schema which allow me to access the B tables without prefixing them.
I get the error:
Error report:
ORA-00900: invalid SQL statement
ORA-06512: at line 26
00900. 00000 - "invalid SQL statement"
*Cause:
*Action:
I ran out of ideas and I do not have access to any of the Oracle instance to be able to debug right now.
Variable type for v_tables is wrong? I do not have some magic privilege to use execute immediate with variable?
Oracle server has a bad day today?
The crap is 11.1.0.7 if it has anything to do with my problem.
Please help if you can.
Grzegorz
declare
v_number number := 646989;
v_current_table nvarchar2(50);
v_itemno number;
type t is table of nvarchar2(50);
v_tables t;
begin
dbms_output.put_line('Working...');
select table_name bulk collect into v_tables from all_tab_cols where column_name = 'ITEMNO' order by table_name;
for i in 1 .. v_tables.count loop
dbms_output.put_line('Number: ' || i);
v_current_table := v_tables(i);
<b>execute immediate 'select count(*) from ' || v_current_table || ' where itemno = :a' into v_itemno using v_number;</b>
if (v_itemno > 0) then
dbms_output.put_line('Current table contains specific ITEMNO: ' || v_current_table);
end if;
end loop;
end;In SQL Plus run this and see what SQL is your code returning. Then execute the SQL individually.
set serveroutput on
declare
v_number number := 646989;
v_current_table nvarchar2(50);
v_itemno number;
type t is table of nvarchar2(50);
v_tables t;
lSqlString varchar2(20000);
begin
select table_name
bulk collect into v_tables
from all_tab_cols
where column_name = 'ITEMNO'
order by table_name;
for i in 1 .. v_tables.count loop
v_current_table := v_tables(i);
lSqlString := 'select count(*) from ' || v_current_table || ' where itemno = :a';
dbms_output.put_line(lSqlString);
--execute immediate lSqlString into v_itemno using v_number;
end loop;
end;
Maybe you are looking for
-
How to Publish a report created by Oracle report builder
Hi Everyone My colleague and I were trying to use the Oracle Reports Builder to replace our existing reports generator from our ERP system. We have already created the report in the Reports Builder from the development suite. What we are looking for
-
[SOLVED]Can't start mpd
I tried today to setup mpd, so I could connect ncmcpp to it, but it seems that it fails everytime I try to "systemctl start mpd". My config for mpd (/etc/mpd.conf) # Files and directories ####################################################### music_
-
Hello, This question Must be post again and again by many fellow , but they are so widely different each other .So , the core problem is : HOW TO LOCATE THE Point where the JVM crash so , if any one could give me a solution or say something about it
-
I bought Macbook Air with WD Thunderbolt and Viewsonic screen. If I connect the screen to Macbook Air, it works. I connect Hard Drive first and screen connnect to Hard Drive. The color just went off. I have try on RGB and DVI. It has same result
-
Hi all! This is something that doesn't always happen: I've received a pps file which won't open either with PowerPoint or neoOffice apps. PowerPoint stops responding and I must force quit the app as well as force quite the corresponding MS error repo