The Scriptures suggest that David was a popular king.
And when all the people came to cause David to eat meat while it was yet day, David sware, saying, So do God to me, and more also, if I taste bread, or ought else, till the sun be down.
36And all the people took notice of it, and it pleased them: as whatsoever the king did pleased all the people.
37For all the people and all Israel understood that day that it was not of the king to slay Abner the son of Ner. — 2 Samuel 3:35-37
This passage is speaking of a time when David mourned for Abner, one of king Saul's generals previously, after he was murdered by Joab. David began to fast for Abner's sake, and the people encouraged him to eat, but he refused to. When he refused to, the people were pleased by it for no other reason than that it was David's decision. That indicates that David was well-liked by the people. However, this event took place before David committed adultery with Bethsheba, and before Absalom attempted to overthrow him.
It is possible that, after it was known that David had committed adultery, many of the people lost their respect for him, seeing as adultery was (and is, certainly) a great sin, and was to be punished with death invariably. That could explain why Absalom was supported enough by the people to almost be able to overthrow him, but only after he committed adultery.
However, after Absalom was killed and his rebellion ended, and David wept for him, the text says,
And it was told Joab, Behold, the king weepeth and mourneth for Absalom.
2And the victory that day was turned into mourning unto all the people: for the people heard say that day how the king was grieved for his son. — 2 Samuel 19:1-2
The people acted in this instance in a similar way that they did in the former one in that they shared David's emotion, although they may not have necessarily had the same reason as David for it, and so they likely shared his emotion only because he was their king; this indicates that David was well-liked. This also indicates that a minority of the people were responsible for the rebellion, although they were enough for it to almost have been successful.
In addition to these things, the fact that David was often seen as the ideal man in Jewish literature suggests that he was very popular with the people of his time, because they caused that reputation of him to continue after he died. This makes sense, since David was a successful militaryman and a very pious man, whom God had blessed.