Daily Archives

Articles indexed Friday May 28 2010

Page 6/107 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • vim: how do I keep 10 lines visible when scrolling up to EOF with CRTL-F ???

    - by Gaston
    Hello! I am used to use vi, not vim. What I find annoying in vim is that when you are scrolling with CTRL-F and reach EOF, vim scrolls down to the very last line and put this line on the top of your screen, and you can't see the lines above. You must scroll up a little bit so you can see the context. All this happens with CTRL-F only, not with j or the down cursor key. In vi, you scroll down (with CTRL-F), but when you reach EOF it still show you, say, 15 lines and then the tippical ~. I am using Putty for remote access. How can I config vim to behave like vi in this case? Hope you understand the question. Thank you! Gaston.

    Read the article

  • Advantages of a Website

    With all the new blogging features that are available today, one might almost think that it is better to just set up a blog, as it is much cheaper and easier to work with. However, I still think that there are many advantages to having your own website as opposed to just a blog.

    Read the article

  • How to detect how many time the users have click the button...

    - by Jerry
    Hello guys. Just want to know if there is a way to detect how many times a user has clicked a button by using Jquery. My main application has a button that can add input fields depend on the users. He/She can adds as many input fields as they need. When they submit the form, The add page will add the data to my database. My current idea is to create a hidden input field and set the value to zero. Every time a user clicks the button, jquery would update the attribute of the hidden input field value. Then the "add page" can detect the loop time. See the example below. I just want to know if there are better practices to do this. Thanks for the helps. main page <form method='post' action='add.php'> //omit <input type="hidden" id="add" name="add" value="0"/> <input type="button" id="addMatch" value="Add a match"/> //omit </form> jquery $(document).ready(function(){ var a =0; $("#addMatch").live('click', function(){ $('#table').append("<input name='match"+a+"Name' />") //the input field will append //as many as the user wants. a++; $('#add').attr('name', 'a'); //pass the a value to hidden input field return false; }); Add Page $a=$_POST['a']; // for($k=0;$k<$a;$k++){ //get all matchName input field $matchName=$_POST['match'.$k.'Name']; //insert the match $updateQuery=mysql_query("INSERT INTO game (team) values('$matchName')",$connection); if(!$updateQuery){ DIE('mysql Error:'+mysql_error()); }

    Read the article

  • Quartz Window Services equivalent for Windows and X11?

    - by Jake Petroules
    What is the equivalent of Quartz Window Services for Windows and X11? I want to be able to capture individual windows with their decorations, shadows, etc., completely independent from each other. Basically what the Son of Grab example is able to do. http://developer.apple.com/mac/library/samplecode/SonOfGrab/Introduction/Intro.html Also it seems like it's not possible to capture non-top-level windows with QWS in Mac. For example I want to be able to capture a Java or Flash applet running inside Firefox. What other library would I need to use instead?

    Read the article

  • Create draggables by draging mouse

    - by Joe
    Hi: I am new to JQuery library. I am currently trying to create a Draggable by mouse. Say, when I press the mouse it start to draw and then I drag the mouse to change the size and then I release the mouse to finalize the drawing. Is it possible to do this with JQuery? Thank you in advance. Joe

    Read the article

  • not readable PDF files

    - by Michal_R
    Hello, I am writing Master's thesis - NLP system. I have one component - extractor. It is extracting a plain text from PDF files. There are a few PDF files that can not be extracted correctly. Extractor (PDFBox library) returns a string like this: "¦xDn¦if|d+gDF"Ti&cD+lh d FÁhis~n +xd f«"d¦ffih »h" or "10a61a91a22a25a3a27a17a23a20a8a13a14a61a25a17" I was checking each file that makes this extraction's problem and all these files' text also can not be copy-pasted from PDF Reader (Adobe Reader and FoxIt reader). Viewing them in this readers is enabled, but after selecting its content and copying to the clipboard I get the same wrong text (as described above - strings of not semanticaly correct chars or strings of digits and letters) Could anybody help me??? THX :)

    Read the article

  • Intercept keystrokes to a window

    - by MTsoul
    Is it possible to intercept a keystroke (and characters) sent to a window? By intercept, I mean play man-in-the-middle, instead of having just hooks onto the Window. I'd like to filter (i.e. eliminate some keystrokes) keystrokes to a window.

    Read the article

  • php oop and mysql

    - by gloris
    I need to get data, to check and send to db. Programming with PHP OOP. Could you tell me if my class structure is good and how dislpay all data?. Thanks <?php class Database{ private $DBhost = 'localhost'; private $DBuser = 'root'; private $DBpass = 'root'; private $DBname = 'blog'; public function connect(){ //Connect to mysql db } public function select($rows){ //select data from db } public function insert($rows){ //Insert data to db } public function delete($rows){ //Delete data from db } } class CheckData{ public $number1; public $number2; public function __construct(){ $this->number1 = $_POST['number1']; $this->number2 = $_POST['number2']; } function ISempty(){ if(!empty($this->$number1)){ echo "Not Empty"; $data = new Database(); $data->insert($this->$number1); } else{ echo "Empty1"; } if(!empty($this->$number2)){ echo "Not Empty"; $data = new Database(); $data->insert($this->$number2); } else{ echo "Empty2"; } } } class DisplayData{ //How print all data? function DisplayNumber(){ $data = new Database(); $data->select(); } } $check = new CheckData(); $check->ISempty(); $display = new DisplayData() $display->DisplayNumber(); ?>

    Read the article

  • JPA and MySQL transaction isolation level

    - by armandino
    I have a native query that does a batch insert into a MySQL database: String sql = "insert into t1 (a, b) select x, y from t2 where x = 'foo'"; EntityTransaction tx = entityManager.getTransaction(); try { tx.begin(); int rowCount = entityManager.createNativeQuery(sql).executeUpdate(); tx.commit(); return rowCount; } catch(Exception ex) { tx.rollback(); log.error(...); } This query causes a deadlock: while it reads from t2 with insert .. select, another process tries to insert a row into t2. I don't care about the consistency of reads from t2 when doing an insert .. select and want to set the transaction isolation level to READ_UNCOMMITTED. How do I go about setting it in JPA?

    Read the article

  • iPhone: Get indexPath of Predicate Object

    - by Nic Hubbard
    I am using a predicate to find an object in core data. I can successfully find the object that I want, but I need to also get the indexPath of that object, so that I can push a details view in for that object. Currently I have the following code for getting my object: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:[NSEntityDescription entityForName:@"Ride" inManagedObjectContext:self.managedObjectContext]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"title = %@ AND addressFull = %@", view.annotation.title, view.annotation.subtitle]; [fetchRequest setPredicate:predicate]; NSMutableArray *sortDescriptors = [NSMutableArray array]; [sortDescriptors addObject:[[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES] autorelease]]; [sortDescriptors addObject:[[[NSSortDescriptor alloc] initWithKey:@"addressFull" ascending:YES] autorelease]]; [fetchRequest setSortDescriptors:sortDescriptors]; [fetchRequest setReturnsObjectsAsFaults:NO]; [fetchRequest setPropertiesToFetch:[NSArray arrayWithObjects:@"title", @"addressFull", nil]]; NSError *error = nil; NSArray *fetchedItems = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; // Sohow what record we returned NSLog(@"%@",[fetchedItems objectAtIndex:0]); So, I can correctly get my object into an array. But how do I translate that object into an indexPath?

    Read the article

  • What if a large number of objects are passed to my SwingWorker.process() method?

    - by Trejkaz
    I just found an interesting situation. Suppose you have some SwingWorker (I've made this one vaguely reminiscent of my own): public class AddressTreeBuildingWorker extends SwingWorker<Void, NodePair> { private DefaultTreeModel model; public AddressTreeBuildingWorker(DefaultTreeModel model) { } @Override protected Void doInBackground() { // Omitted; performs variable processing to build a tree of address nodes. } @Override protected void process(List<NodePair> chunks) { for (NodePair pair : chunks) { // Actually the real thing inserts in order. model.insertNodeInto(parent, child, parent.getChildCount()); } } private static class NodePair { private final DefaultMutableTreeNode parent; private final DefaultMutableTreeNode child; private NodePair(DefaultMutableTreeNode parent, DefaultMutableTreeNode child) { this.parent = parent; this.child = child; } } } If the work done in the background is significant then things work well - process() is called with relatively small lists of objects and everything is happy. Problem is, if the work done in the background is suddenly insignificant for whatever reason, process() receives a huge list of objects (I have seen 1,000,000, for instance) and by the time you process each object, you have spent 20 seconds on the Event Dispatch Thread, exactly what SwingWorker was designed to avoid. In case it isn't clear, both of these occur on the same SwingWorker class for me - it depends on the input data, and the type of processing the caller wanted. Is there a proper way to handle this? Obviously I can intentionally delay or yield the background processing thread so that a smaller number might arrive each time, but this doesn't feel like the right solution to me.

    Read the article

  • SQL SERVER – Disabled Index and Update Statistics

    - by pinaldave
    When we try to update the statistics, it throws an error as if the clustered index is disabled. Now let us enable the clustered index only and attempt to update the statistics of the table right after that. Have you ever come across the situation where a conversation never gets over and it continues even though original point of discussion has passed. I am facing the same situation in the case of Disabled Index. Here is the link to original conversations. SQL SERVER – Disable Clustered Index and Data Insert – Reader had a issue here with Disabled Index SQL SERVER – Understanding ALTER INDEX ALL REBUILD with Disabled Clustered Index – Reader asked the effect of Rebuilding Indexes The same reader asked me today – “I understood what the disabled indexes do; what is their effect on statistics. Is it true that even though indexes are disabled, they continue updating the statistics?“ The answer is very interesting: If you have disabled clustered index, you will be not able to update the statistics at all for any index. If you have enabled clustered index and disabled non clustered index when you update the statistics of the table, it automatically updates the statistics of the ALL (disabled and enabled – both) the indexes on the table. If you are not satisfied with the answer, let us go over a simple example. I have written necessary comments in the code itself to have a clear idea. USE tempdb GO -- Drop Table if Exists IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[TableName]') AND type IN (N'U')) DROP TABLE [dbo].[TableName] GO -- Create Table CREATE TABLE [dbo].[TableName]( [ID] [int] NOT NULL, [FirstCol] [varchar](50) NULL ) GO -- Insert Some data INSERT INTO TableName SELECT 1, 'First' UNION ALL SELECT 2, 'Second' UNION ALL SELECT 3, 'Third' UNION ALL SELECT 4, 'Fourth' UNION ALL SELECT 5, 'Five' GO -- Create Clustered Index ALTER TABLE [TableName] ADD CONSTRAINT [PK_TableName] PRIMARY KEY CLUSTERED ([ID] ASC) GO -- Create Nonclustered Index CREATE UNIQUE NONCLUSTERED INDEX [IX_NonClustered_TableName] ON [dbo].[TableName] ([FirstCol] ASC) GO -- Check that all the indexes are enabled SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO Now let us update the statistics of the table and check the statistics update date. -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO Now let us disable the indexes and check if they are disabled using sys.indexes. -- Disable Indexes -- Disable Nonclustered Index ALTER INDEX [IX_NonClustered_TableName] ON [dbo].[TableName] DISABLE GO -- Disable Clustered Index ALTER INDEX [PK_TableName] ON [dbo].[TableName] DISABLE GO -- Check that all the indexes are disabled SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO Let us try to update the statistics of the table. -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO /* -- Above operation should thrown following error Msg 1974, Level 16, State 1, Line 1 Cannot perform the specified operation on table 'TableName' because its clustered index 'PK_TableName' is disabled. */ When we try to update the statistics it throws an error as it clustered index is disabled. Now let us enable the clustered index only and attempt to update the statistics of the table right after that. -- Now let us rebuild clustered index only ALTER INDEX [PK_TableName] ON [dbo].[TableName] REBUILD GO -- Check that all the indexes status SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO We can clearly see that even though the nonclustered index is disabled it is also updated. If you do not need a nonclustered index, I suggest you to drop it as keeping them disabled is an overhead on your system. This is because every time the statistics are updated for system all the statistics for disabled indexesare also updated. -- Clean up DROP TABLE [TableName] GO The complete script is given below for easy reference. USE tempdb GO -- Drop Table if Exists IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[TableName]') AND type IN (N'U')) DROP TABLE [dbo].[TableName] GO -- Create Table CREATE TABLE [dbo].[TableName]( [ID] [int] NOT NULL, [FirstCol] [varchar](50) NULL ) GO -- Insert Some data INSERT INTO TableName SELECT 1, 'First' UNION ALL SELECT 2, 'Second' UNION ALL SELECT 3, 'Third' UNION ALL SELECT 4, 'Fourth' UNION ALL SELECT 5, 'Five' GO -- Create Clustered Index ALTER TABLE [TableName] ADD CONSTRAINT [PK_TableName] PRIMARY KEY CLUSTERED ([ID] ASC) GO -- Create Nonclustered Index CREATE UNIQUE NONCLUSTERED INDEX [IX_NonClustered_TableName] ON [dbo].[TableName] ([FirstCol] ASC) GO -- Check that all the indexes are enabled SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO -- Disable Indexes -- Disable Nonclustered Index ALTER INDEX [IX_NonClustered_TableName] ON [dbo].[TableName] DISABLE GO -- Disable Clustered Index ALTER INDEX [PK_TableName] ON [dbo].[TableName] DISABLE GO -- Check that all the indexes are disabled SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO /* -- Above operation should thrown following error Msg 1974, Level 16, State 1, Line 1 Cannot perform the specified operation on table 'TableName' because its clustered index 'PK_TableName' is disabled. */ -- Now let us rebuild clustered index only ALTER INDEX [PK_TableName] ON [dbo].[TableName] REBUILD GO -- Check that all the indexes status SELECT OBJECT_NAME(OBJECT_ID), Name, type_desc, is_disabled FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'TableName' GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO -- Update the stats of table UPDATE STATISTICS TableName WITH FULLSCAN GO -- Check Statistics Last Updated Datetime SELECT name AS index_name, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes WHERE OBJECT_ID = OBJECT_ID('TableName') GO -- Clean up DROP TABLE [TableName] GO Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Index, SQL Optimization, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Statistics

    Read the article

  • New to ASP.NET: Webforms vs MVC2

    - by Sahat
    I am new to ASP.NET Development and can't decide between developing with Webforms or MVC 2. Nevermind the pros and cons of each. I've seen mixed opinions of each. But which method would be the best for someone who has no prior experience in ASP.NET or C#? If your answer is: learn both, then which should I learn first? MVC 2 or Webforms?

    Read the article

  • Lookup site column not saving/storing metadata for Office 2007 documents?

    - by Greg Hurlman
    I'm having this issue on several server environments. We have a list at the site collection root. There is a site column created as a multi-value lookup on that list's Title field. This site column is used in document libraries in subsites as a required field. When we upload anything but an Office 2007 document, the user is presented with the document metadata fill-in screen (EditForm.aspx?Mode=Upload), the user fills in the appropriate data (including picking a value(s) for this lookup), and clicks "check in" - the document is checked in as expected, with the lookup field's value filled in. With an Office 2007 document, this fails. The user selected values for the lookup field do not ever make it to the server - no errors are thrown, but the field is not saved with the document. We have an event listener on these document libraries, and if we inspect the incoming SPListItem on the event listener method before a single line of our code has run, we see that the value for the lookup field is null. It smells like a SharePoint bug to me - but before I go calling Microsoft, has anyone seen this & worked around it? Edit: the only entry I see in the SP trace logs relating to the problem: CMS/Publishing/8ztg/Medium/Got List Item Version, but item was null

    Read the article

  • forward invocation, by hand vs magically?

    - by John Smith
    I have the following two class: //file FruitTree.h @interface FruitTree : NSObject { Fruit * f; Leaf * l; } @end //file FruitTree.m @implementation FruitTree //here I get the number of seeds from the object f @end //file Fruit @interface Fruit : NSObject { int seeds; } -(int) countfruitseeds; @end My question is at the point of how I request the number of seeds from f. I have two choices. Either: Since I know f I can explicitly call it, i.e. I implement the method -(int) countfruitseeds { return [f countfruitseeds]; } Or: I can just use forwardInvocation: - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { // does the delegate respond to this selector? if ([f respondsToSelector:selector]) return [f methodSignatureForSelector:selector]; else if ([l respondsToSelector:selector]) return [l methodSignatureForSelector:selector]; else return [super methodSignatureForSelector: selector]; } - (void)forwardInvocation:(NSInvocation *)invocation { [invocation invokeWithTarget:f]; } (Note this is only a toy example to ask my question. My real classes have lots of methods, which is why I am asking.) Which is the better/faster method?

    Read the article

  • loading css or javascript from non-public directory

    - by twmulloy
    is there a way to load css and/or javascript files from outside of the public web directory? for example on my hosting service i have /public_html but don't want these files to exist in the public directory and want them in a directory outside of the public directory in a sibling directory /system (i am using codeigniter) within the /system/application/view/

    Read the article

  • Problems with variadic function

    - by morpheous
    I have the following function from some legacy code that I am maintaining. long getMaxStart(long start, long count, const myStruct *s1, ...) { long i1, maxstart; myStruct *s2; va_list marker; maxstart = start; /*BUGFIX: 003 */ /*(va_start(marker, count);*/ va_start(marker, s1); for (i1 = 1; i1 <= count; i1++) { s2 = va_arg(marker, myStruct *); /* <- s2 is assigned null here */ maxstart = MAX(maxstart, s2->firstvalid); /* <- SEGV here */ } va_end(marker); return (maxstart); } When the function is called with only one myStruct argument, it causes a SEGV. The code compiled and run without crashing on Windows XP when I compiled it using VS2005. I have now moved the code to Ubuntu Karmic and I am having problems with the stricter compiler on Linux. Is anyone able to spot what is causing the parameter not to be read correctly in the var_arg() statement? I am compiling using gcc version 4.4.1 Edit The statement that causes the SEGV is this one: start = getMaxStart(start, 1, ms1); The variables 'start' and 'ms1' have valid values when the code execution first reaches this line.

    Read the article

  • get a array use params

    - by Small Wolf
    Hey,Guys! In rails , I met a question! when i use the multiple select ,i don't know ,how can i get the all parameter values ,it likes in javaEE, String[] strs=request.getParameters("aaa"); so,who can tell me the method in rails to realize the function? Thank you in advance!

    Read the article

  • What is the best Linux distribution as a Xen host?

    - by St3fan
    I ordered a server for the home office and I would like to partition it with Xen. I think this will keep things clean and easier to maintain. I will be running things like MySQL, PostgreSQL, Tomcat and my own code on this machine. My question is: what freely available Linux distribution has the best Xen hosting facilities?

    Read the article

  • JOptionPane opening another JFrame

    - by mike_hornbeck
    So I'm continuing my fight with this : http://stackoverflow.com/questions/2923545/creating-java-dialogs/2926126 task. Now my JOptionPane opens new window with envelope overfiew, but I can't change size of this window. Also I wanted to have sender's data in upper left corner, and receiver's data in bottom right. How can I achieve that ? There is also issue with OptionPane itself. After I click 'OK' it opens small window in the upper left corner of the screen. What is this and why it's appearing ? My code: import java.awt.*; import java.awt.Font; import javax.swing.*; public class Main extends JFrame { private static JTextField nameField = new JTextField(20); private static JTextField surnameField = new JTextField(); private static JTextField addr1Field = new JTextField(); private static JTextField addr2Field = new JTextField(); private static JComboBox sizes = new JComboBox(new String[] { "small", "medium", "large", "extra-large" }); public Main(){ JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); getContentPane().add(mainPanel); JPanel addrPanel = new JPanel(new GridLayout(0, 1)); addrPanel.setBorder(BorderFactory.createTitledBorder("Receiver")); addrPanel.add(new JLabel("Name")); addrPanel.add(nameField); addrPanel.add(new JLabel("Surname")); addrPanel.add(surnameField); addrPanel.add(new JLabel("Address 1")); addrPanel.add(addr1Field); addrPanel.add(new JLabel("Address 2")); addrPanel.add(addr2Field); mainPanel.add(addrPanel); mainPanel.add(new JLabel(" ")); mainPanel.add(sizes); String[] buttons = { "OK", "Cancel"}; int c = JOptionPane.showOptionDialog( null, mainPanel, "My Panel", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, buttons, buttons[0] ); if(c ==0){ new Envelope(nameField.getText(), surnameField.getText(), addr1Field.getText() , addr2Field.getText(), sizes.getSelectedIndex()); } setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setVisible(true); } public static void main(String[] args) { new Main(); } } class Envelope extends JFrame { private final int SMALL=0; private final int MEDIUM=1; private final int LARGE=2; private final int XLARGE=3; public Envelope(String n, String s, String a1, String a2, int i){ Container content = getContentPane(); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(new JLabel("John Doe")); mainPanel.add(new JLabel("FooBar str 14")); mainPanel.add(new JLabel("Newark, 45-99")); JPanel dataPanel = new JPanel(); dataPanel.setFont(new Font("sansserif", Font.PLAIN, 32)); //set size from i mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.setBackground(Color.ORANGE); mainPanel.add(new JLabel("Mr "+n+" "+s)); mainPanel.add(new JLabel(a1)); mainPanel.add(new JLabel(a2)); content.setSize(450, 600); content.setBackground(Color.ORANGE); content.add(mainPanel, BorderLayout.NORTH); content.add(dataPanel, BorderLayout.SOUTH); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setVisible(true); } }

    Read the article

  • How to customize tooltip for silverlight control?

    - by KentZhou
    SL provide ToolTipService.ToolTip for simple tooltip. I want to customize tooltip with my own user control. One way is to do something like: <TextBlock Text="Hello" > <ToolTipService.ToolTip> <TextBlock Text="I can help you." /> <!--replace this with user control --> </ToolTipService.ToolTip> </TextBlock> But what I want is: 1) create a style for tooltip, so that it can be set as something like <TextBlock Text="Hello" Style="{StaticResource TextBlockWithToolTip}" > 2) Content for tooltip can be set dynamically from datacontext, such as title, content, etc. How to implement it?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >